blob: c6ac6c99ccb89209895588e2aa9bb2395e0759ff (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
// Output //
Please enter the width of your kite in centimeters. Use values between 1 - 400 cm.
450
Please try again with a value between 1 - 400
100
Now enter the length, again between 1 - 400cm.
30
The dimensions of your kite are 100.000cm by 30.000cm.
The area is 0.300 square meters.
The aspect ratio is 3.333
WARNING: A lower aspect ratio might provide better stability.
Your kite has a mass of 40.500 grams.
The kite is experiencing a gravitational force of 396.900 newtons.
//
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.";
|