summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanturcas <[email protected]>2022-10-23 15:59:39 -0700
committerNathanturcas <[email protected]>2022-10-23 15:59:39 -0700
commit10c7e4c31beab434e51017d9177237e1062638f3 (patch)
treed33cebda42eef56cf19c3bf7420e88d6cc9fdbe5
parentcommit 1 (diff)
downloadcst116-lab1-nathanturcas-10c7e4c31beab434e51017d9177237e1062638f3.tar.xz
cst116-lab1-nathanturcas-10c7e4c31beab434e51017d9177237e1062638f3.zip
commit 2
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index 53c8b7f..ba6bd72 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -11,21 +11,28 @@ using std::endl;
int main()
{
- float width, height,area;
+ float width, length, area, ratio;
cout << "Enter width (cm) : ";
cin >> width;
- cout << "Enter height (cm) : ";
- cin >> height;
+ cout << "Enter length (cm) : ";
+ cin >> length;
cout << "width: ";
cout << width<< endl;
- cout << "height: ";
- cout << height << endl;
+ cout << "length: ";
+ cout << length << endl;
- area = (width * height / 2) / 10000;
+ area = (width * length / 2) / 10000;
cout << "area (m) : ";
cout << area << endl;
+ ratio = width / length;
+ cout << "ratio: ";
+ cout << ratio << endl;
+ if (ratio >= 1)
+ cout << "a lower aspect ratio would provide more stability";
+
+
}