diff options
| author | prestonderek <[email protected]> | 2022-10-07 14:32:47 -0700 |
|---|---|---|
| committer | prestonderek <[email protected]> | 2022-10-07 14:32:47 -0700 |
| commit | 16dffca8c6a31b384e8c91d6d2ce3993aa959a7a (patch) | |
| tree | e806ebe07c953d3464ba2bd1ca5e2aadebf6be78 /CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp | |
| parent | Step 7 of debug 1 (diff) | |
| download | cst116-ch6-debugging-prestonderek-16dffca8c6a31b384e8c91d6d2ce3993aa959a7a.tar.xz cst116-ch6-debugging-prestonderek-16dffca8c6a31b384e8c91d6d2ce3993aa959a7a.zip | |
Commit at step 7 of debug 2
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 1899f81..4a64f00 100644 --- a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp +++ b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp @@ -36,7 +36,8 @@ ********************************************************************/
//Commit at step 6. Output was -32 which isn't right!
-//After adding () around fahrenheit - 32 I got the answer as 0C in output.
+//After adding () around fahrenheit - 32 I got the answer as 0C in output. Wrong!!
+//Commit at debug 2 #7. Answer was 100C which is correct.
#include <iostream>
#include <iomanip>
@@ -54,7 +55,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;
|