Assignment 2

extended to Friday 28 January at 5:00 PM. (was Thursday 27 January at 01:00 AM.)

Write a program that will:

  1. Declare two variables of type float, called temp_f and temp_c. These will represent temperatures in the Fahrenheit and Celsius units, respectively.
  2. Initialize temp_f to 18.4.
  3. Compute the corresponding Celsius temperature using the formula. To convert Fahrenheit to Celsius, subtract 32 and divide by 1.8. Store this value in temp_c
  4. 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.