diff options
| author | JonCr <[email protected]> | 2022-11-12 00:13:03 -0800 |
|---|---|---|
| committer | JonCr <[email protected]> | 2022-11-12 00:13:03 -0800 |
| commit | 875dfeb5d3703a33a6f0260eb0c8af4306af3b51 (patch) | |
| tree | c6ec09ca90147daab9cb3317d34984eeba416b0a /BlankConsoleLab/BlankConsoleLab.cpp | |
| parent | Update (diff) | |
| download | cst116-lab2-cognitiveshadow-master.tar.xz cst116-lab2-cognitiveshadow-master.zip | |
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -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; |