From 57117db83c64b9efd64b3609ba02eb8f471bf28a Mon Sep 17 00:00:00 2001 From: Nataliia Brown Date: Sun, 28 Jan 2024 00:11:04 -0800 Subject: added #ifdef VERBOSE --- Homework_2/Homework_2/HW_2.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Homework_2/Homework_2/HW_2.cpp b/Homework_2/Homework_2/HW_2.cpp index 6a24e4e..722120c 100644 --- a/Homework_2/Homework_2/HW_2.cpp +++ b/Homework_2/Homework_2/HW_2.cpp @@ -6,13 +6,21 @@ #include - using std::cout; using std::cin; using std::endl; +#define VERBOSE + + int main() { + +#ifdef VERBOSE + cout << "30C to F\n"; + cout << "F = 32 + (9/5 * 30C)\n"; + cout << "F = 86\n"; + int i, y, b; cout << "Please enter 0 to convert from Celsius to Fahrenheit or 1 to convert from Fahrenheit to Celsius" << endl; @@ -31,9 +39,9 @@ int main() cout << "Please enter the temperature in Celsius to convert to Fahrenheit" << endl; cin >> x; - + y = (x * (9.0 / 5.00)) + 32; - + cout << "Your temperature is " << y << " in Fahrenheit" << endl; if (y < 40) @@ -78,7 +86,7 @@ int main() } break; - + #endif // #ifdef VERBOSE } return 0; } -- cgit v1.2.3