diff options
| author | Evan <[email protected]> | 2022-10-03 20:18:16 -0700 |
|---|---|---|
| committer | Evan <[email protected]> | 2022-10-03 20:18:16 -0700 |
| commit | 701183cdef1e4f9c86f749d71cf7654db1b9a7e1 (patch) | |
| tree | 66672f63fd1977131b3530bd4bd71cd827a46328 /CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp | |
| parent | remove 2nd temp (diff) | |
| download | cst116-ch6-debugging-evanmihm-main.tar.xz cst116-ch6-debugging-evanmihm-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, 5 insertions, 0 deletions
diff --git a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp index f877062..0a94e0d 100644 --- a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp +++ b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp @@ -43,17 +43,22 @@ using std::endl; int main()
{
+ //defines the terms fahrenheit and celcius
float fahrenheit = 0;
float celcius = 0;
+ //requires user input to set a temperature
cout << "Enter temperature in Fahrenheit: ";
cin >> fahrenheit;
// Breakpoint 1
// Put a breakpoint on the following line
+
+ //this is the equation to convert fahrenheit to celcius
celcius = (float)(5.0 / 9.0) * (fahrenheit - 32);
+ //displays the converted temperature in celcius
cout << fahrenheit << " degrees in F = " \
<< celcius << " degrees in C" << endl;
|