summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdwardFine <[email protected]>2022-10-06 15:22:44 -0700
committerEdwardFine <[email protected]>2022-10-06 15:22:44 -0700
commitfac409be18e62257377978f4a56f9e026b3240d3 (patch)
tree17b91d80c516ff65c4cb0379228095f908329d20
parentPrint out area (diff)
downloadcst116-lab1-edwardfine-fac409be18e62257377978f4a56f9e026b3240d3.tar.xz
cst116-lab1-edwardfine-fac409be18e62257377978f4a56f9e026b3240d3.zip
Compute Aspect Ratio
-rw-r--r--BlankConsoleLab/CST116-Lab1-Fine.cpp6
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);