September 2015
Beginner
110 pages
2h 6m
English
| 18 | Temperature Converter |
You’ll often need to determine which part of a program is run based on user input or other events.
Create a program that converts temperatures from Fahrenheit to Celsius or from Celsius to Fahrenheit. Prompt for the starting temperature. The program should prompt for the type of conversion and then perform the conversion.
The formulas are
and
| | Press C to convert from Fahrenheit to Celsius. |
| | Press F to convert from Celsius to Fahrenheit. |
| | Your choice: C |
| | |
| | Please enter the temperature in Fahrenheit: 32 |
| | The temperature ... |
Read now
Unlock full access