CS 102
Assignment 2
extended to Friday 28 January at 5:00 PM. (was Thursday 27 January at 01:00 AM.)
Write a program that will:
-
Declare two variables of type
float, calledtemp_fandtemp_c. These will represent temperatures in the Fahrenheit and Celsius units, respectively. -
Initialize
temp_fto18.4. -
Compute the corresponding Celsius temperature using the formula.
To convert Fahrenheit to Celsius, subtract
32and divide by1.8. Store this value intemp_c - Print out a message like “18.4 degrees Fahrenheit is XX.YY degrees Celsius.”
It will not be correct to calculate the Celsius units by hand, or by calculator, or by Google. It must be a calculation performed by your program.
Submit by attaching your .cpp file to an email.