From 8ecf0d3d95ff567c5afd6f26f352456406f4fc67 Mon Sep 17 00:00:00 2001 From: Nathanturcas Date: Sun, 23 Oct 2022 16:13:37 -0700 Subject: commit 3 --- BlankConsoleLab/BlankConsoleLab.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'BlankConsoleLab/BlankConsoleLab.cpp') diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index ba6bd72..3e4a160 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -14,9 +14,23 @@ int main() float width, length, area, ratio; cout << "Enter width (cm) : "; - cin >> width; + cin >> width; + while (width < 1 || width > 400) + { + cout << "value must be between 1 and 400" << endl; + cout << "Enter width (cm) : "; + cin >> width; + } cout << "Enter length (cm) : "; cin >> length; + while (length < 1 || length > 400) + { + cout << "value must be between 1 and 400" << endl; + cout << "Enter length (cm) : "; + cin >> length; + } + + cout << "width: "; cout << width<< endl; -- cgit v1.2.3