summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
diff options
context:
space:
mode:
authorHannah Wu <[email protected]>2022-10-26 00:10:33 -0700
committerHannah Wu <[email protected]>2022-10-26 00:10:33 -0700
commit2fdb8425f47eb2dcd8896127a70977656b091ac7 (patch)
tree02eb70437729fd5d2023be920c522037abb30469 /BlankConsoleLab/BlankConsoleLab.cpp
parentreplaced integers with float. added calculations for printing area in square ... (diff)
downloadcst116-lab1-wu-2fdb8425f47eb2dcd8896127a70977656b091ac7.tar.xz
cst116-lab1-wu-2fdb8425f47eb2dcd8896127a70977656b091ac7.zip
added calculation of aspect ratio and warning
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp14
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;
+
+
+
+
+
+
}