summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/CST116-Lab1-Hill-Flowchart.txt
diff options
context:
space:
mode:
authortafaar <[email protected]>2022-10-16 00:20:44 -0700
committertafaar <[email protected]>2022-10-16 00:20:44 -0700
commita4f9a187c793ea54fcf41f2ac787c8a584f8a9f6 (patch)
tree0d309a5f77150c9120c0fcedb51bd50889d7387c /BlankConsoleLab/CST116-Lab1-Hill-Flowchart.txt
parentadded a warning (diff)
downloadcst116-lab1-hill-a4f9a187c793ea54fcf41f2ac787c8a584f8a9f6.tar.xz
cst116-lab1-hill-a4f9a187c793ea54fcf41f2ac787c8a584f8a9f6.zip
some formatting, added the flowchart. finished
Diffstat (limited to 'BlankConsoleLab/CST116-Lab1-Hill-Flowchart.txt')
-rw-r--r--BlankConsoleLab/CST116-Lab1-Hill-Flowchart.txt35
1 files changed, 35 insertions, 0 deletions
diff --git a/BlankConsoleLab/CST116-Lab1-Hill-Flowchart.txt b/BlankConsoleLab/CST116-Lab1-Hill-Flowchart.txt
new file mode 100644
index 0000000..057e230
--- /dev/null
+++ b/BlankConsoleLab/CST116-Lab1-Hill-Flowchart.txt
@@ -0,0 +1,35 @@
+FLOATS width, length;
+
+PRINT "Please enter the width of your kite in centimeters. Use values between 1 - 400 cm.";
+
+DO {
+
+ SET width;
+ IF ( width IS LESS THAN 1, OR, width is GREATER THAN 400 )
+ PRINT "Please try again with a value between 1 - 400";
+
+} WHILE ( width is LESS THAN 1, OR, width is GREATER THAN 400);
+
+PRINT "Now enter the length, again between 1 - 400cm.";
+
+DO {
+
+ SET length;
+ IF ( length IS LESS THAN 1, OR, length is GREATER THAN 400 )
+ PRINT "Please try again with a value between 1 - 400";
+
+} WHILE ( length is LESS THAN 1, OR, length is GREATER THAN 400);
+
+PRINT "The dimensions of your kite are " + width + " by " + length + "cm.";
+
+DOUBLE area = (width * length) / 10000.0
+FLOAT aspectRatio = width / length;
+
+IF (aspectRatio >= 1){
+ PRINT "WARNING: A lower aspect ratio might provide better stability.";
+}
+
+CONSTANT FLOAT mass = 135.0f * area;
+DOUBLE forceGravity = 9.8 * mass;
+
+PRINT "Your kite has a mass of " + mass + " grams." ENDLINE "The kite is experiencing a gravitational force of " + forceGravity + " newtons."; \ No newline at end of file