From 2fdb8425f47eb2dcd8896127a70977656b091ac7 Mon Sep 17 00:00:00 2001 From: Hannah Wu Date: Wed, 26 Oct 2022 00:10:33 -0700 Subject: added calculation of aspect ratio and warning --- BlankConsoleLab/BlankConsoleLab.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'BlankConsoleLab/BlankConsoleLab.cpp') 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; + + + + + + } -- cgit v1.2.3