summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanturcas <[email protected]>2022-10-23 16:13:37 -0700
committerNathanturcas <[email protected]>2022-10-23 16:13:37 -0700
commit8ecf0d3d95ff567c5afd6f26f352456406f4fc67 (patch)
tree46b8fc99f8ee2e178a22998170e3ddffb8039a08
parentcommit 2 (diff)
downloadcst116-lab1-nathanturcas-8ecf0d3d95ff567c5afd6f26f352456406f4fc67.tar.xz
cst116-lab1-nathanturcas-8ecf0d3d95ff567c5afd6f26f352456406f4fc67.zip
commit 3
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp16
1 files changed, 15 insertions, 1 deletions
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;