diff options
| author | DoolyBoi <[email protected]> | 2022-10-19 19:52:55 -0700 |
|---|---|---|
| committer | DoolyBoi <[email protected]> | 2022-10-19 19:52:55 -0700 |
| commit | b0766e541a4cebbc54b4df5a1f05fe43865b4990 (patch) | |
| tree | e484b636ecdedb67913b14614c94384b83f11886 | |
| parent | takes user input, calculates area, turns into square meters, tells area to user (diff) | |
| download | cst116-lab1-abd00l4h-b0766e541a4cebbc54b4df5a1f05fe43865b4990.tar.xz cst116-lab1-abd00l4h-b0766e541a4cebbc54b4df5a1f05fe43865b4990.zip | |
aspect ratio and warning
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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."; + } } |