summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
diff options
context:
space:
mode:
authoralexandra-apetroaei <andra@MSI>2022-10-17 21:56:47 -0800
committeralexandra-apetroaei <andra@MSI>2022-10-17 21:56:47 -0800
commitfd2a3376acd66b91c990fb9f334f572e0fdb8a9d (patch)
tree1a1e3a874534e56271ed00404db932087b3a461f /BlankConsoleLab/BlankConsoleLab.cpp
parentStep two complete (diff)
downloadcst116-lab1-alexandra-apetroaei-fd2a3376acd66b91c990fb9f334f572e0fdb8a9d.tar.xz
cst116-lab1-alexandra-apetroaei-fd2a3376acd66b91c990fb9f334f572e0fdb8a9d.zip
made a few more changes
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp32
1 files changed, 25 insertions, 7 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index 558a738..f43a99e 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -12,23 +12,41 @@ using std::endl;
int main()
{
float width;
- float height;
+ float length;
float area;
float aspect_ratio;
float isStable = false;
while (isStable == false)
{
- // Ask user for width and height in centimeters
+ // Ask user for width and length in centimeters
cout << "Insert width (in centimeters): " << endl ;
- cin >> height;
-
- cout << "Insert height (in centimeters): " << endl ;
cin >> width;
- // Display width and height to user
- cout << "You entered: " << width << "cm for width, and " << height << "cm for height" << endl;
+ cout << "Insert length (in centimeters): " << endl ;
+ cin >> length;
+
+ // Display width and length to user
+ cout << "You entered: " << width << "cm for width, and " << length << "cm for length" << endl;
+
+ // Formula to compute area of a kite
+ area = ((width * length) / 2) / 1000;
+ cout << "The area of the kite is: " << area << "in square meters" << endl;
+
+ aspect_ratio = (width / length);
+
+ if (aspect_ratio >= 1)
+ {
+ cout << "Warning: " << aspect_ratio << "is too high and should be lowered to provie stability! " << endl;
+
+ }
+ else
+ {
+ cout << "Aspect ratio:" << aspect_ratio << endl;
+ }
+
+ return 0;
}