aboutsummaryrefslogtreecommitdiff
path: root/Homework_2
diff options
context:
space:
mode:
Diffstat (limited to 'Homework_2')
-rw-r--r--Homework_2/Homework_2/HW_2.cpp16
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;
}