summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/cst116-lab1-wilson.cpp
diff options
context:
space:
mode:
authorjacobdw22 <[email protected]>2022-10-17 19:20:04 -0700
committerjacobdw22 <[email protected]>2022-10-17 19:20:04 -0700
commit673d28679daca8581b1d9aa7a1b954f75373b27c (patch)
tree449257dd1294dfe1630e28076f1c5bf7c48ac169 /BlankConsoleLab/cst116-lab1-wilson.cpp
parentPart 1 Semi-Final Change (diff)
downloadcst116-lab1-jacobdw22-673d28679daca8581b1d9aa7a1b954f75373b27c.tar.xz
cst116-lab1-jacobdw22-673d28679daca8581b1d9aa7a1b954f75373b27c.zip
simple changes
Diffstat (limited to 'BlankConsoleLab/cst116-lab1-wilson.cpp')
-rw-r--r--BlankConsoleLab/cst116-lab1-wilson.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/BlankConsoleLab/cst116-lab1-wilson.cpp b/BlankConsoleLab/cst116-lab1-wilson.cpp
index f71b36c..cc076b2 100644
--- a/BlankConsoleLab/cst116-lab1-wilson.cpp
+++ b/BlankConsoleLab/cst116-lab1-wilson.cpp
@@ -14,13 +14,24 @@ int main()
float width = 0;
float length = 0;
float area;
+ const int mass = 0;
float aspect_ratio;
- cout << "What is the width of the kite in centimeters: ";
- cin >> width;
-
- cout << "What is the length of the kite in centimeters: ";
- cin >> length;
+ while (true) {
+ cout << "What is the width of the kite in centimeters: ";
+ if (cin >> width && (width >= 1 && width <= 400)) {
+ break;
+ }
+ cout << "Please enter a number between 1 and 400 centimeters." << endl;
+ }
+
+ while (true) {
+ cout << "What is the length of the kite in centimeters: ";
+ if (cin >> length && (length >= 1 && length <= 400)) {
+ break;
+ }
+ cout << "Please enter a number between 1 and 400 centimeters." << endl;
+ }
cout << "The width is " << width << " centimeters and the length is "
<< length << " centimeters." << endl;
@@ -36,5 +47,7 @@ int main()
else if (aspect_ratio < 1)
cout << "Aspect ratio < 1. Good aspect ratio.";
+
+
}