diff options
| author | EdwardFine <[email protected]> | 2022-10-06 15:22:44 -0700 |
|---|---|---|
| committer | EdwardFine <[email protected]> | 2022-10-06 15:22:44 -0700 |
| commit | fac409be18e62257377978f4a56f9e026b3240d3 (patch) | |
| tree | 17b91d80c516ff65c4cb0379228095f908329d20 | |
| parent | Print out area (diff) | |
| download | cst116-lab1-edwardfine-fac409be18e62257377978f4a56f9e026b3240d3.tar.xz cst116-lab1-edwardfine-fac409be18e62257377978f4a56f9e026b3240d3.zip | |
Compute Aspect Ratio
| -rw-r--r-- | BlankConsoleLab/CST116-Lab1-Fine.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/BlankConsoleLab/CST116-Lab1-Fine.cpp b/BlankConsoleLab/CST116-Lab1-Fine.cpp index f33866b..b37b273 100644 --- a/BlankConsoleLab/CST116-Lab1-Fine.cpp +++ b/BlankConsoleLab/CST116-Lab1-Fine.cpp @@ -13,10 +13,11 @@ using std::endl; int main() { - int length; - int width; + float length; + float width; int correct = 0; float area; + float aspectRatio; while (correct == 0) { cout << "How long is your kite in centimeters? "; cin >> length; @@ -30,6 +31,7 @@ int main() area = (length * width) / 2.0; area = area / 10000; cout << "Your Kite's area is " << area << "meters squared."; + aspectRatio = (width / length); |