Question: Exercise 2 Write a C++program that reads a number followed by one space and then a letter. If the letter following the number is f,

 Exercise 2 Write a C++program that reads a number followed by

Exercise 2 Write a C++program that reads a number followed by one space and then a letter. If the letter following the number is f, the program should treat the entered number as a temperature in Fahrenheit, convert the number to e equivalent Celsius temperature and print a suitable display message. If the letter following the number is c the program should perform the opposite conversion (from Celsius to Fahrenheit. If the letter is neither fnor c the program should print a message that the data entered is incorrect and terminate. Use the following formulas for converting between Fahrenheit and Celsius: Celsius = Fahrenheit-32) Fahrenheit 5 (Celsius +32) Use two digits after the decimal point when displaying the converted temperature. C: studio 201 he temperature in Celsuis-.555556 ress any key to continue studio 2010 ease enter the temperature followed by character f orc he temperature in Fahrenheit-63 ress any key to continue studio 201 owed by character f or c he data entered is incorrect and terminate ress any key to continue

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!