From 875dfeb5d3703a33a6f0260eb0c8af4306af3b51 Mon Sep 17 00:00:00 2001 From: JonCr Date: Sat, 12 Nov 2022 00:13:03 -0800 Subject: Finished --- BlankConsoleLab/BlankConsoleLab.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'BlankConsoleLab/BlankConsoleLab.cpp') 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; -- cgit v1.2.3