summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei F <[email protected]>2022-10-19 22:05:17 -0700
committerAndrei F <[email protected]>2022-10-19 22:05:17 -0700
commit381ef6214d528bbb4759693b0f3bf2c6d51e1739 (patch)
tree9c83bafafdb9ba936912461be683d933ce382be3
parentAdded comments (diff)
downloadcst116-lab1-florea-381ef6214d528bbb4759693b0f3bf2c6d51e1739.tar.xz
cst116-lab1-florea-381ef6214d528bbb4759693b0f3bf2c6d51e1739.zip
Finished part 2
-rw-r--r--BlankConsoleLab/CST-116-Project1-Florea.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/BlankConsoleLab/CST-116-Project1-Florea.cpp b/BlankConsoleLab/CST-116-Project1-Florea.cpp
index df81f12..bde2914 100644
--- a/BlankConsoleLab/CST-116-Project1-Florea.cpp
+++ b/BlankConsoleLab/CST-116-Project1-Florea.cpp
@@ -20,6 +20,7 @@ int main()
float width = 0;
float length = 0;
float area, ratio;
+ double gravitatonal_pull;
// This will take in input for width and length in the range of 1, 400 inclusive. If it's outside the range,
// then the loop will repeat until given the correct values.
@@ -39,9 +40,13 @@ int main()
cout << "Area (in square meters): " << area << " M^2" << endl;
- const float mass = 135 * area; // Finds the total mass of the kite.
- cout << "If your kite is using a medium weight fabric, it is calculated to weigh: " << mass << " grams/meter^2"
- << endl;
+ const float mass = (135 * area) / 1000; // Finds the total mass of the kite.
+ cout << "If your kite is using a medium weight fabric (135g/sq meter), "
+ "it is calculated to weigh: " << mass << " kg/meter^2"
+ << endl;
+
+ gravitatonal_pull = mass * 9.8;
+ cout << "Gravitational pull on your kite is: " << gravitatonal_pull << " (mass * 9.8 N/kg)" << endl;
ratio = width / length; // Finds aspect ratio of kite