diff options
| author | Evan <[email protected]> | 2022-11-09 22:52:57 -0800 |
|---|---|---|
| committer | Evan <[email protected]> | 2022-11-09 22:52:57 -0800 |
| commit | 8d22c5d2b41a044731632453def6f26f6a8e5c1c (patch) | |
| tree | d7ae8f2fd3fd3b820312668e2ef02775c1069a30 /BlankConsoleLab/BlankConsoleLab.cpp | |
| parent | h (diff) | |
| download | cst116-lab2-evanmihm-8d22c5d2b41a044731632453def6f26f6a8e5c1c.tar.xz cst116-lab2-evanmihm-8d22c5d2b41a044731632453def6f26f6a8e5c1c.zip | |
g
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 9a870a3..98047d5 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -10,9 +10,7 @@ char y; char n; int fahrenheit(int t); -int windchill(); - - +//changes celsius to farenheit int fahrenheit(int t) { int f{}; @@ -26,7 +24,7 @@ int fahrenheit(int t) int main() { float t{}; - float f{}; + int f{}; float w{}; float wc{}; char choice{}; @@ -36,19 +34,15 @@ int main() cin >> t; //makes sure temp is between -80 and 121 - while (t < -80 || t > 121) + if (t < -80 || t > 121) { cout << "Input invalid, please enter a number between -80 and 121" << endl; cin.ignore(99, '\n'); return t; } + - cout << f << endl; - - - - - cout << "type y or n" << " is the tempterature in fahrenheit?"; + cout << "type y or n" << " is the tempterature in fahrenheit?"<<endl; // cin >> choice; if (choice == 'n') { |