diff options
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index da5b275..fca81a9 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -8,18 +8,32 @@ int main() float area, ratio; cout << "Kite Math 0.2" << endl; - cout << "Please input the width of your kite:" << endl; - cin >> width; - cout << "Please input the length of your kite:" << endl; - cin >> length; - cout << endl; + + do { + cout << "Input the width of your kite:" << endl; + cin >> width; + if (width < 1 || width > 400) + cout << "Input a valid number." << endl; + cout << endl; + } while (width < 1 || width > 400); + + do { + cout << "Input the length of your kite:" << endl; + cin >> length; + if (length < 1 || length > 400) + cout << "Input a valid number." << endl; + cout << endl; + } while (length < 1 || length > 400); + cout << "Width: " << width << endl; cout << "length: " << length << endl; + area = (width * length) / 2; area = area / 10000; ratio = width / length; + cout << "Ratio: " << ratio << endl; if (ratio >= 1) { cout << "A lower aspect ratio may provide more kit stability" << endl; } |