diff options
| author | DoolyBoi <[email protected]> | 2022-10-04 14:49:57 -0700 |
|---|---|---|
| committer | DoolyBoi <[email protected]> | 2022-10-04 14:49:57 -0700 |
| commit | 3c907445bf5f933f4e4cb1aee164997288c5d787 (patch) | |
| tree | e644053573271fbd405cc9bfd31fd94a43fccbe4 /CST116-Ch6-Debugging | |
| parent | Setting up GitHub Classroom Feedback (diff) | |
| download | cst116-ch6-debugging-abd00l4h-3c907445bf5f933f4e4cb1aee164997288c5d787.tar.xz cst116-ch6-debugging-abd00l4h-3c907445bf5f933f4e4cb1aee164997288c5d787.zip | |
fixed program to actually change farenheit to celcius
Diffstat (limited to 'CST116-Ch6-Debugging')
| -rw-r--r-- | CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp index 497e2f8..8d10f37 100644 --- a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp +++ b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp @@ -12,7 +12,7 @@ * 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? -32 Is that the correct value? No.
* 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 +51,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;
|