Problem

(Program) Write, compile, and run a C++ program that accepts a number followed by one sp...

(Program) Write, compile, and run a C++ program that accepts a number followed by one space and then a letter. If the letter following the number is f, the program is to treat the number entered as a temperature in degrees Fahrenheit, convert the number to the equivalent degrees Celsius, and display a suitable message. If the letter following the number is c, the program is to treat the number entered as a temperature in degrees Celsius, convert the number to the equivalent degrees Fahrenheit, and display a suitable message. If the letter is neither f nor c, the program is to display a message that the data entered is incorrect and then terminate. Use an if-else chain in your program and make use of these conversion formulas:

Celsius = (5.0 / 9.0) × (Fahrenheit - 32.0)

Fahrenheit = (9.0 / 5.0) × Celsius + 32.0

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 4.3