diff options
| author | Hannah Wu <[email protected]> | 2022-10-26 00:10:33 -0700 |
|---|---|---|
| committer | Hannah Wu <[email protected]> | 2022-10-26 00:10:33 -0700 |
| commit | 2fdb8425f47eb2dcd8896127a70977656b091ac7 (patch) | |
| tree | 02eb70437729fd5d2023be920c522037abb30469 /BlankConsoleLab | |
| parent | replaced integers with float. added calculations for printing area in square ... (diff) | |
| download | cst116-lab1-wu-2fdb8425f47eb2dcd8896127a70977656b091ac7.tar.xz cst116-lab1-wu-2fdb8425f47eb2dcd8896127a70977656b091ac7.zip | |
added calculation of aspect ratio and warning
Diffstat (limited to 'BlankConsoleLab')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 5da2bc7..aee8676 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -23,11 +23,25 @@ int main() cout << "You have entered " << width << " for width." << endl; cout << "You have entered " << length << " for length." << endl; + + float ratio = (width / length); + + if (ratio >= 1) + { + cout << "WARNING: A lower aspect ratio will provide more stability." << endl; + } + float areacm = (width * length/2); float areamt = (areacm / 10000); cout << "The area of the kite in square meters is " << areamt << endl; + + + + + + } |