From 9359d4fa0ad65edee8095fcaa306eb48467b1935 Mon Sep 17 00:00:00 2001 From: Andrei F Date: Wed, 19 Oct 2022 22:12:39 -0700 Subject: Added pseudo code --- BlankConsoleLab/CST-116-Project1-Florea.cpp | 6 +++--- CST-116-Project1-PseudoCode-Florea.txt | 30 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 CST-116-Project1-PseudoCode-Florea.txt diff --git a/BlankConsoleLab/CST-116-Project1-Florea.cpp b/BlankConsoleLab/CST-116-Project1-Florea.cpp index bde2914..5c3fb96 100644 --- a/BlankConsoleLab/CST-116-Project1-Florea.cpp +++ b/BlankConsoleLab/CST-116-Project1-Florea.cpp @@ -20,7 +20,7 @@ int main() float width = 0; float length = 0; float area, ratio; - double gravitatonal_pull; + double gravitational_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. @@ -45,8 +45,8 @@ int main() "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; + gravitational_pull = mass * 9.8; + cout << "Gravitational pull on your kite is: " << gravitational_pull << " (mass * 9.8 N/kg)" << endl; ratio = width / length; // Finds aspect ratio of kite diff --git a/CST-116-Project1-PseudoCode-Florea.txt b/CST-116-Project1-PseudoCode-Florea.txt new file mode 100644 index 0000000..0c57f1f --- /dev/null +++ b/CST-116-Project1-PseudoCode-Florea.txt @@ -0,0 +1,30 @@ +variable width, set it to 0 +variable length, set it to 0 +variable area +variable ratio +variable gravitational_pull + +enter while loop (condition is width and length being in range 1-400 inclusive) + display "Please only enter WIDTH and LENGTH between 1 - 400" + display "Please enter the WIDTH of your kite in centimeters" + input value into width + + display "Please enter the LENGTH of your kite in centimeters" + input value into length + +display "Width" + width + "Length" + length + +set area equal to (width * length) / 2 +set area equal to itself / 10000 (this converts to square meters) + +display "Area in suqare meters" + area + +variable mass, set it equal to (135 * area) / 1000 (finds mass in kg/meter^2) + +set gravitational_pull equal to mass * 9.8 + +set ratio to width / length + +if ratio is equal to or more than 1 + display "Warning: a lower aspect ratio would provide more stability" + display "Current aspect ratio: " + ratio + " (width/length)" \ No newline at end of file -- cgit v1.2.3