From c125861250c23e2368db1efaf0956dcce28c431d Mon Sep 17 00:00:00 2001 From: JonCr Date: Thu, 10 Nov 2022 23:59:24 -0800 Subject: Debugging --- BlankConsoleLab/BlankConsoleLab.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 8b62456..f70e4dc 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -63,25 +63,25 @@ float getTemp(int& select) if (select == 1) { - while (temp < minC || temp > maxC) + while (temp < minF || temp > maxF) { cout << endl << "Enter temperature: "; cin >> temp; - if (temp < minC || temp > maxC) - cout << endl << "Please enter between " << minC << " and " << maxC << "." << endl; + if (temp < minF || temp > maxF) + cout << endl << "Please enter between " << minF << " and " << maxF << "." << endl; } } if (select == 2) { - while (temp < minF || temp > maxF) + while (temp < minC || temp > maxC) { cout << endl << "Enter temperature: "; cin >> temp; - if (temp < minF || temp > maxF) - cout << endl << "Please enter between " << minF << " and " << maxF << "." << endl; + if (temp < minC || temp > maxC) + cout << endl << "Please enter between " << minC << " and " << maxC << "." << endl; } } @@ -91,13 +91,13 @@ float calcTemp(float& Celsius) { float Fahrenheit = 0; - Fahrenheit = (9 / 5) * Celsius + 32; + Fahrenheit = 32 + ((9 * Celsius) / 5); return Fahrenheit; } float getWindSpeed() { - float windSpeed = 0; + float windSpeed = -100; { while (windSpeed < 0 || windSpeed > 231) -- cgit v1.2.3