diff options
| author | [email protected] <[email protected]> | 2022-10-05 16:19:33 -0700 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2022-10-05 16:19:33 -0700 |
| commit | baa84bc3223bf6b7276eaba62381aec325c31c24 (patch) | |
| tree | d19e1346851824ca2634ebd756827e4a75a68559 /BlankConsoleLab/BlankConsoleLab.cpp | |
| parent | Push 4 (diff) | |
| download | cst116-lab1-smith-baa84bc3223bf6b7276eaba62381aec325c31c24.tar.xz cst116-lab1-smith-baa84bc3223bf6b7276eaba62381aec325c31c24.zip | |
Push 5
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 9cf1e55..2619b7b 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -17,9 +17,12 @@ float w, l, area, aspect_ratio; int main() { //Collecting the length and width of the kite in centimeters - while !(w >= 1) - cout << "Please input the width of the kite in centimeters." << endl; + cout << "Please input the width of the kite in centimeters." << endl; cin >> w; + while (w < 1 || w > 400) { + cout << "That number is invalid. Please try again with a number between 1 and 400."; + cin >> w; + } cout << "Now please input the length of the kite in centimeters." << endl; cin >> l; |