diff options
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index ac5d528..0705133 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -18,36 +18,41 @@ int main() float ratio; - cout << "Enter Length of kite in cm: "; - cin >> length; + do + { + cout << "Enter Length of kite in cm: "; + cin >> length; - cout << "Enter Width of kite in cm: "; - cin >> width; + cout << "Enter Width of kite in cm: "; + cin >> width; - cout << "Length = " << length << " cm" << endl; + cout << "Length = " << length << " cm" << endl; - cout << "Width = " << width << " cm" << endl; + cout << "Width = " << width << " cm" << endl; + } while ((length < 1 || length > 400) || (width < 1 || width > 400)); + - -// area calculation + // area calculation area = (length * width) / 2; -// unit conversion + // unit conversion meters = area / 10000; cout << "Kite area: " << meters << " square meters" << endl; -// aspect ratio + // aspect ratio ratio = width / length; - if (ratio > 1) - cout << "WARNING! A lower aspect ratio would provide more stability" << endl; + if (ratio > 1) + cout << "WARNING! A lower aspect ratio would provide more stability" << endl; + + + return 0; +} + - return 0; - -} |