From 381ef6214d528bbb4759693b0f3bf2c6d51e1739 Mon Sep 17 00:00:00 2001 From: Andrei F Date: Wed, 19 Oct 2022 22:05:17 -0700 Subject: Finished part 2 --- BlankConsoleLab/CST-116-Project1-Florea.cpp | 11 ++++++++--- 1 file 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 -- cgit v1.2.3