diff options
Diffstat (limited to 'CST116-Lab1-Pearse-Pseudocode.txt')
| -rw-r--r-- | CST116-Lab1-Pearse-Pseudocode.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/CST116-Lab1-Pearse-Pseudocode.txt b/CST116-Lab1-Pearse-Pseudocode.txt new file mode 100644 index 0000000..0e95bdd --- /dev/null +++ b/CST116-Lab1-Pearse-Pseudocode.txt @@ -0,0 +1,27 @@ +const float MASSPERSQUAREMETER = 0.135 + +main(){ + float length + float width + bool leave = false + while(!leave){ + print("Please enter the length, then width of the kite in centimeters.") + input(length) + input(width) + if (1 <= width && width <= 400 && 1 <= length && length <= 400){ + leave = true + } + } + float area = (length * width) / 2 + area = area / 10000 + float aspectratio = width / length + if (aspectratio >= 1){ + print("Warning: a lower aspect ratio will provide more stability.") + } + float mass = MASSPERSQUAREMETER * area + float gravitationalPull = mass * 9.8 + + print("Length of the kite " + length + "cm.") + print("Width of the kite " + width + "cm.") + print("Area of the kite " + area + "m^2.") +}
\ No newline at end of file |