From 7ab4b91cfab3c810e88cdbb6c0b8834b075780b7 Mon Sep 17 00:00:00 2001 From: ludwig Date: Tue, 16 Aug 2022 12:29:20 -0500 Subject: [PATCH] Comments --- converter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/converter.cpp b/converter.cpp index 7e8b425..365eb65 100644 --- a/converter.cpp +++ b/converter.cpp @@ -5,7 +5,7 @@ using namespace std; -void Menu(){ +void Menu(){ // <- The menu is (mostly) static, no need for it to be in main cout << "Simple temperature converter \n"; cout << "Conversion options \n [1]C to F \n [2]F to C \n [3]Quit" << endl; cout << "Select option [1-3]: "; @@ -13,12 +13,12 @@ void Menu(){ double C, F; -double convertC(double C, double F){ +double convertC(double C, double F){ // <- converts to Celsius C = (F - 32) / 1.8; return(C); } -double convertF(double C, double F){ +double convertF(double C, double F){ // <- converts to fahrenheit F = (C * 1.8) + 32; return(F); } @@ -40,7 +40,7 @@ int main() { } else if (input == 2){ - cout << "Enter temperature in Fahrenheit: "; // <- should this be C to F? + cout << "Enter temperature in Fahrenheit: "; cin >> input; F = input; cout << convertC(C, F);