Question: 1. The formula for converting a temperature from Fahrenheit to Celsius is: C = 5/9(F 32) The formula for converting a temperature from Celsius to

1. The formula for converting a temperature from Fahrenheit to Celsius is: C = 5/9(F 32) The formula for converting a temperature from Celsius to Fahrenheit is: F = 9/5C + 32 In both formulas, 5 divided by 9 and 9 divided by 5 should return a decimal (i.e. / is NOT integer division). Write a function named CtoF that accepts a temperature in Celsius, converts it to Fahrenheit and returns the value to the main program. Write a second function named FtoC that accepts a temperature in Fahrenheit, converts it to Celsius and returns the value to the main program. Write a void function that accepts a converted temperature and whether it is of unit F or C, and prints the results. The main() function should ask the user which conversion they wish to do (enter F for Fahrenheit, C for Celsius, and Q for quit) and the temperature to convert. Then calls the appropriate convert function, and finally the print function. It should then loop until the user enters a Q to quit

2. Rewrite the above program so that all functions are of void type. Use a reference parameter, temperature, that act as the vehicle in which to pass in the temperature to convert and return the converted temperature, allowing it to be changed within the function..

It's for a C++ class.

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!