diff options
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 16 |
1 files 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) |