diff options
| author | Andrei F <[email protected]> | 2022-10-19 21:28:56 -0700 |
|---|---|---|
| committer | Andrei F <[email protected]> | 2022-10-19 21:28:56 -0700 |
| commit | e559a9f3c0a77299ef120bce3fa3dc236b7737ab (patch) | |
| tree | 827247ecd35d6e1669eff2ac93b931852d77d801 /BlankConsoleLab/BlankConsoleLab.cpp | |
| parent | Finished step 2 (diff) | |
| download | cst116-lab1-florea-e559a9f3c0a77299ef120bce3fa3dc236b7737ab.tar.xz cst116-lab1-florea-e559a9f3c0a77299ef120bce3fa3dc236b7737ab.zip | |
Finished steps 3-7
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 01f5b44..c9deecf 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -17,7 +17,7 @@ using std::endl; int main() { - float width, length; + float width, length, area, ratio; cout << "Please enter the WIDTH of your kite in centimeters (decimals are OK): "; cin >> width; @@ -26,6 +26,16 @@ int main() cout << "Width: " << width << " | Length: " << length << endl; + area = (width * length) / 2; + area /= 10000; + + cout << "Area (in square meters): " << area << " M^2" << endl; + + ratio = width / length; + if(ratio >= 1){ + cout << "Warning: a lower aspect ratio would provide more stability." << endl; + cout << "Current aspect ratio (width / length): " << ratio << endl; + } } |