diff options
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 98047d5..2ea3bef 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -43,21 +43,21 @@ int main() cout << "type y or n" << " is the tempterature in fahrenheit?"<<endl; - // cin >> choice; - if (choice == 'n') + cin >> t; + if (char choice = 'n') { f = fahrenheit(t); } - if (choice == 'y') + else if (char choice = 'y') { - cout << "no change"; + cin >> f; } //collects windspeed cout << "Enter a wind speed between 0 and 231: "; cin >> w; //windspeed between 0-231 - while (w < 0 || w > 231) + if (w < 0 || w > 231) { cout << "Input invalid, please enter a number between 0 and 231" << endl; cin.ignore(99, '\n'); @@ -67,11 +67,9 @@ int main() //f = temp w = wind wc = (35.74 + 0.6215 * f - 35.75 * pow(w, 0.16) + .4275 * f * pow(w, 0.16)); - return wc; - //displays wind, temp, and windchill - cout << w << endl; - cout << f << endl; - cout << wc << endl; + cout << w << " wind" << endl; + cout << f << " temp" << endl; + cout << wc << " wind chill" << endl; }
\ No newline at end of file |