/* convert.cpp * * A temperature conversion program. This program * has some bugs! * * Debugger tutorial file courtesy of Hannah Tang */ #include "function.h" int main(void){ double fahrenheit; double celsius; int choice = 1; // Don't want to have an initial value of 3! while (choice != 3){ // What does the user want to do? choice = getUserChoice(); // Quit the program if (choice == 3) return 0; // Celsius to Fahrenheit if (choice = 1) { celsius = getUserTemperature(); fahrenheit = celToFahr(celsius); cout << celsius << " C -> " << fahrenheit << " F\n\n"; } else { // The choice was 2 -- Fahrenheit to Celsius fahrenheit = getUserTemperature(); celsius = fahrToCel(fahrenheit); cout << fahrenheit << " F -> " << celsius << " C\n\n"; } } return 0; }