From 7870bb40fdff8149258ad396ee877733b78ecce2 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 9 Nov 2022 23:15:15 -0800 Subject: gg --- BlankConsoleLab/BlankConsoleLab.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'BlankConsoleLab/BlankConsoleLab.cpp') diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 2ea3bef..f9bf9b2 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -11,19 +11,19 @@ char n; int fahrenheit(int t); //changes celsius to farenheit -int fahrenheit(int t) +int fahrenheit(int x) { int f{}; //f = (t * (9 / 5)) + 32; - f = (9 / 5) * t + 32; + f = (9 / 5) * x + 32; return f; } int main() { - float t{}; + float x{}; int f{}; float w{}; float wc{}; @@ -31,24 +31,22 @@ int main() //collects a temp cout << "Enter a temperature between -80 and 121: "; - cin >> t; + cin >> x; //makes sure temp is between -80 and 121 - if (t < -80 || t > 121) + if (x < -80 || x > 121) { cout << "Input invalid, please enter a number between -80 and 121" << endl; cin.ignore(99, '\n'); - return t; } - + - cout << "type y or n" << " is the tempterature in fahrenheit?"<> t; - if (char choice = 'n') + cout << "type y or n," << " is the tempterature in fahrenheit?"<> f; } @@ -61,7 +59,6 @@ int main() { cout << "Input invalid, please enter a number between 0 and 231" << endl; cin.ignore(99, '\n'); - return w; } //f = temp w = wind -- cgit v1.2.3