Temperature Conversion
Objective
To practice using variables, input, output and simple calculations.Task
For this lab, you will write a program that reads in a temperature in Fahrenheit, and converts it to Celsius and Kelvin. To convert from Fahrenheit to Celsius, you should subtract 32, then multiply by 5/9. To convert from Celsius to Kelvin, you should simply add 273.15.
Details
- Prompt the user to enter a Fahrenheit temperature.
- Read in the value using a Scanner object.
- Perform the calculations.
- Output the temperature in Celsius and Kelvin. Include the units in the output.
- Be sure to use the double type to maintain precision.
Submitting
When your program works, email the code to ifinlay@umw.edu.