Question: Please write the program in C++. Please explain. Thank you. (11 points) Convert temperature: Write, compile, and test a C++ program that uses a switch


Please write the program in C++. Please explain. Thank you.
(11 points) Convert temperature: Write, compile, and test a C++ program that uses a switch structure where the user is prompted to enter a temperature and a unit (c, C, f, or F). If the temperature is entered in degrees Fahrenheit it should be converted to degrees Celsius. If the temperature is entered in degrees Celsius it should be converted to Fahrenheit. Hint: Read the temperature as a double and the unit as a char. Example: Input: 35.2 c Output: 35.2 degrees C = 95.4 degrees F The output should display the result in both degrees C and degrees F as real numbers. The program should print an error message if an invalid unit is entered. Test the program for the 7 inputs shown below. o Oc o 100 C o 35.2 c o 32 f o 212 F o 95.4 F O Any number followed by an invalid letter
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
