| Lexington High School Mathematics | Math Dept. Front Page | Student Links | Family Links |
| Introduction to C++, Kevin Kelly | Kelly Front Page | C++ Course Guide | C++ Assignments | C++ Info |
Summary of the assignment: Write a temperature conversion program that gives the user a choice of which direction to convert (from F to C or from C to F).
User interface: Begin by presenting the user with a menu of options. If the user types C, prompt for a Celsius temperature and convert it to Fahrenheit. If the user types F, prompt for a Fahrenheit temperature and convert it to Celsius. If the user types anything else, just exit without doing any conversion.
Programming specifics: Please store the user's choice in a char variable. Allow the user to type either upper or lower case (accept either C or c). The temperature calculations must be done in two functions FtoC and CtoF, not in the main program. (You can reuse the function or functions that you've already written for Assignment 9.)
For 10 pts.: Besides writing a program that works exactly as described above, also hand in a second program that converts among three temperature scales: Fahrenheit, Celsius, and Kelvin. Redesign the user interface so that it begins by asking two questions: (1) from which scale to convert, (2) to which scale to convert.