From 70f189191b922b7bb38d098cbf342e2a8e38237c Mon Sep 17 00:00:00 2001 From: CEOofOogaBooga Date: Tue, 18 Oct 2022 19:57:49 -0700 Subject: Width size done --- BlankConsoleLab/BlankConsoleLab.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'BlankConsoleLab/BlankConsoleLab.cpp') diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index a7eb14e..b487b33 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -15,8 +15,13 @@ float area = 0; float ratio = 0; int main() { - cout << "Enter width in cm: "; - cin >> width; + while (width > 400 || 1 > width) + { + cout << "Enter width in cm: "; + cin >> width; + if (width > 400 || 1 > width) + cout << "Number cannot be greater than 400 or less than 1" << endl; + }; cout << "Enter length in cm: "; cin >> length; area = ((length * width)/2.0)/10000.0; -- cgit v1.2.3