diff options
| author | Nataliia Brown <[email protected]> | 2024-01-28 00:11:04 -0800 |
|---|---|---|
| committer | Nataliia Brown <[email protected]> | 2024-01-28 00:11:04 -0800 |
| commit | 57117db83c64b9efd64b3609ba02eb8f471bf28a (patch) | |
| tree | fef719274df273b89da4e6797e5fd0752e5ea632 /Homework_2 | |
| parent | Added options, conversion, statements. (diff) | |
| download | homework-2-natabrown-main.tar.xz homework-2-natabrown-main.zip | |
Diffstat (limited to 'Homework_2')
| -rw-r--r-- | Homework_2/Homework_2/HW_2.cpp | 16 |
1 files 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 <iostream> - 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; } |