diff options
| author | alexandra-apetroaei <andra@MSI> | 2022-10-06 14:20:18 -0800 |
|---|---|---|
| committer | alexandra-apetroaei <andra@MSI> | 2022-10-06 14:20:18 -0800 |
| commit | fb159bf8ff74f3eca53a46db5d98d509872d7bf5 (patch) | |
| tree | 1252914b6c652bcbf4dc8f273e7b888db9cf5719 /CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp | |
| parent | Final change (diff) | |
| download | cst116-ch6-debugging-alexandra-apetroaei-main.tar.xz cst116-ch6-debugging-alexandra-apetroaei-main.zip | |
Diffstat (limited to 'CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp')
| -rw-r--r-- | CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp index 497e2f8..7fa84cb 100644 --- a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp +++ b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp @@ -12,7 +12,8 @@ * 4) When asked for a temperature, enter 212.
* 5) Verify that the value you entered is stored correctly.
* 6) Step over the conversion calculation. What is the value
-* in Celsius? Is that the correct value? No.
+* in Celsius? Is that the correct value? No.
+* 0
* 7) Remember your order of precedence. Put parentheses around
* Fahrenheit - 32. This needs to be done before the multiplication.
* 8) Stop debugging and recompile.
@@ -51,7 +52,7 @@ int main() // Breakpoint 1
// Put a breakpoint on the following line
- celcius = 5 / 9 * fahrenheit - 32;
+ celcius = static_cast<float>(5)/9 * (fahrenheit - 32);
cout << fahrenheit << " degrees F = "
<< celcius << " degrees C" << endl;
|