diff options
| author | Joe Traver <[email protected]> | 2022-10-10 18:52:27 -0700 |
|---|---|---|
| committer | Joe Traver <[email protected]> | 2022-10-10 18:52:27 -0700 |
| commit | d00c352463522ba20e20c8fb1c85f29ccc3e6421 (patch) | |
| tree | c9b65b44b54986d3a9b542aca5d1c5c12b2dd07d | |
| parent | Aswered questions in Exersise 1 (diff) | |
| download | cst116-ch6-debugging-joetraver30-d00c352463522ba20e20c8fb1c85f29ccc3e6421.tar.xz cst116-ch6-debugging-joetraver30-d00c352463522ba20e20c8fb1c85f29ccc3e6421.zip | |
Code Corrected
| -rw-r--r-- | CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp index 497e2f8..3ac8f80 100644 --- a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp +++ b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp @@ -1,5 +1,5 @@ /********************************************************************
-* File: CST116-Ch6-Debugging.cpp
+* File: CST116-Ch6-Debugging-joetraver30.cpp
*
* General Instructions: Complete each step before proceeding to the
* next.
@@ -13,6 +13,9 @@ * 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.
+*
+* -The value is -32 degrees which is not correct-
+*
* 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 +54,7 @@ int main() // Breakpoint 1
// Put a breakpoint on the following line
- celcius = 5 / 9 * fahrenheit - 32;
+ celcius = (5.0 / 9.0) * (fahrenheit - 32);
cout << fahrenheit << " degrees F = "
<< celcius << " degrees C" << endl;
|