From 738bf24e831f8d20751eac89cb7a43b43b4328c6 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 9 Nov 2022 23:09:24 -0800 Subject: j --- BlankConsoleLab/BlankConsoleLab.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'BlankConsoleLab/BlankConsoleLab.cpp') 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?"<> 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 -- cgit v1.2.3