Write a program that first asks the user which Temperature scale conversion would he like to perform: Convert F to C Convert C to F What is your choice? Then it asks the user for input for three real number variables: start_temp, end_temp, temp_incr. It will then produce a two-column Fahrenheit to Celsius table or a two-column Celsius to Fahrenheit table, depending on the choice. For choice 1, The first column should be labeled Fahrenheit and the first value the Fahrenheit column is start_temp. The second column should be labeled Celsius, and its value is calculated from the values in the Fahrenheit column using the formula C = (5.0/9.0)*(F – 32.0). For choice 2, the table will show the Celsius column first, Fahrenheit column second, and use the formula F = 9.0/5.0 * C + 32.0 Write and use functions called calcCelsius (is passed the Fahrenheit temp and returns the Celsius temp) and calcFahrenheit (is passed the Celsius temp and returns the Fahrenheit temp). The values for the temps in the first column will be incremented by temp_incr, and end when the table value would exceed the end_temp value. Display all values with 1 decimal of accuracy, justified, and align
Write a program that first asks the user which Temperature scale conversion would he like to perform:
- Convert F to C
- Convert C to F
What is your choice?
Then it asks the user for input for three real number variables: start_temp, end_temp, temp_incr. It will then produce a two-column Fahrenheit to Celsius table or a two-column Celsius to Fahrenheit table, depending on the choice. For choice 1, The first column should be labeled Fahrenheit and the first value the Fahrenheit column is start_temp. The second column should be labeled Celsius, and its value is calculated from the values in the Fahrenheit column using the formula C = (5.0/9.0)*(F – 32.0). For choice 2, the table will show the Celsius column first, Fahrenheit column second, and use the formula F = 9.0/5.0 * C + 32.0
Write and use functions called calcCelsius (is passed the Fahrenheit temp and returns the Celsius temp) and calcFahrenheit (is passed the Celsius temp and returns the Fahrenheit temp).
The values for the temps in the first column will be incremented by temp_incr, and end when the table value would exceed the end_temp value. Display all values with 1 decimal of accuracy, justified, and aligned.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images