From b0766e541a4cebbc54b4df5a1f05fe43865b4990 Mon Sep 17 00:00:00 2001 From: DoolyBoi Date: Wed, 19 Oct 2022 19:52:55 -0700 Subject: aspect ratio and warning --- BlankConsoleLab/BlankConsoleLab.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'BlankConsoleLab/BlankConsoleLab.cpp') diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index b20ff5c..d0aae5a 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -26,7 +26,7 @@ using std::endl; int main() { //seting up variables - float length, width, area; + float length, width, area, aspectRatio; //output prompt for user to enter length and width cout << "Please enter the length and width of your kite (in that order)." << endl; @@ -41,5 +41,14 @@ int main() //telling the user how many square meters their kite is cout << "The area of your kite is " << area << " square meters." << endl; + + //calculating aspect ratio + aspectRatio = width / length; + + //warns user if aspect ratio is greater than or equal to 1 + if (aspectRatio >= 1) + { + cout << "WARNING: The aspect ratio of your kite is pretty high which would result in less stability. Making a lower aspect ratio would provide more stability."; + } } -- cgit v1.2.3