blob: 057e23054f0a53003e7d6c1cebcfee4aad58a6e3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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.";
|