diff options
| author | Joseph Williams <[email protected]> | 2022-10-15 10:56:00 -0700 |
|---|---|---|
| committer | Joseph Williams <[email protected]> | 2022-10-15 10:56:00 -0700 |
| commit | 721d5eeddaa8e7de6b973680d6c5cf6109c6332e (patch) | |
| tree | d4e7924eca8bc5cbb6bbad536c3599823c3805d6 /BlankConsoleLab | |
| parent | Completed step 6 (warn user about bad aspect ratio). (diff) | |
| download | cst116-lab1-allthenamesaretaken3141-721d5eeddaa8e7de6b973680d6c5cf6109c6332e.tar.xz cst116-lab1-allthenamesaretaken3141-721d5eeddaa8e7de6b973680d6c5cf6109c6332e.zip | |
revised aspect ratio calculations
Diffstat (limited to 'BlankConsoleLab')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 79d0037..898ab8b 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -70,8 +70,11 @@ void aspectRatio(float width, float height) { float ratio = width / height; multiColorPrint(vector<tuple<string, int, bool> > {make_tuple("Your kite has an aspect ratio of ", 15, false), make_tuple(to_string(ratio), 11, false), make_tuple(". ", 15, false)}); - if (ratio >= 1) { - colorPrint("Your kite will fly nice and stable...provided that you do, in fact, actually know how to fly it.", 10); + if (ratio >= 5) { + colorPrint("That number should be above 1, yes, but this seems a little overkill.", 6); + } + else if (ratio >= 1) { + colorPrint("Your kite will fly nice and stable, provided you actually know how to fly it.", 10); } else { @@ -83,21 +86,21 @@ int main() { float width, height; - colorPrint("Welcome to Kite Calculator. I still don't know why I agreed to this job.\n", 13); + colorPrint("Welcome to Kite Calculator, can I take your order.", 13); - colorPrint("Let's start with getting the dimensions of your kite. Or not. I wouldn't mind a break.", 9); + colorPrint("Let's start with getting the dimensions of your kite.", 9); width = getWidthOrHeight("width"); height = getWidthOrHeight("height"); cout << endl; //Tell the user what they just entered, because...reasons. - colorPrint("Great job. You can type numbers on a keyboard. I'm so proud of you.", 10); + colorPrint("Great job. Let's do some math.", 10); multiColorPrint(vector<tuple<string, int, bool> > {make_tuple("Your kite is ", 15, false), make_tuple(to_string(width) + "cm", 11, false), make_tuple(" wide and ", 15, false), make_tuple(to_string(height) + "cm", 11, false), make_tuple(" high.", 15, true), }); //I hate this but its still better than stacking like 20 couts. - colorPrint("I'm sure it's beautiful. Or maybe not. I don't know you.\n", 9); + colorPrint("I'm sure it's beautiful.\n", 9); //Calculate the kite's area and tell it to the user. float area = calulateKiteArea(width, height); - multiColorPrint(vector<tuple<string, int, bool> > {make_tuple("Your kite has an area of ", 15, false), make_tuple(to_string(area) + " square meters", 11, false), make_tuple(". ", 15, false), make_tuple("...I don't get paid enough for this.", 9, true)}); + multiColorPrint(vector<tuple<string, int, bool> > {make_tuple("Your kite has an area of ", 15, false), make_tuple(to_string(area) + " square meters", 11, false), make_tuple(". ", 15, true)); cout << endl; //Do aspect ratio stuff. |