Question: Problem C1 Create a program that asks the user for a temperature in Celsius, computes the corresponding temperature in Fahrenheit, and then prints the temperature

Problem C1

Create a program that asks the user for a temperature in Celsius, computes the corresponding temperature in Fahrenheit, and then prints the temperature in Celsius and Fahrenheit.

To convert from Celsius to Fahrenheit use the mathmetical formula:

 Fahrenheit = Celsius * 9/5 + 32 

Use named constants; do not put numbers down in the code. You need to include the iostream and iomanip libraries. The execution result should have three lines each time the program is run:

1. The input line

2. Celsius: followed by the value from the input, with one decimal position.

3. Fahrenheit: followed by the value converted from the input, with one decimal position.

Align the decimal points for the two lines that print the Celsius and Fahrenheit temperatures.

Test data, run the program three times: First test input 37.778 degrees Celsius Second test input -40 degrees Celsius Third test input 0 degrees Celsius

* I use codelab(C++)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!