diff options
Diffstat (limited to 'BlankConsoleLab')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index dc9df83..a806d9b 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -104,15 +104,13 @@ float getWindSpeed() { float windSpeed = -100; + while (windSpeed < 0 || windSpeed > 231) { - while (windSpeed < 0 || windSpeed > 231) - { - cout << endl << "Enter wind speed in MPH: "; - cin >> windSpeed; + cout << endl << "Enter wind speed in MPH: "; + cin >> windSpeed; - if (windSpeed < 0 || windSpeed > 231) - cout << endl << "Please enter between " << 0 << " and " << 231 << "." << endl; - } + if (windSpeed < 0 || windSpeed > 231) + cout << endl << "Please enter between 0 and 231." << endl; } return windSpeed; |