blob: c6ab8c48f817a9cb325e9b3f7e0e1c21d21b89dc (
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
|
Agile notes and Pseudocode for Lab1
This program requires the following
2 inputs:
length of the kite in meters
width of the kite in meters
Notes:
Ask the user for width and length in cm
Print what the user entered for width and length
Computer the area of the kite using Area=(width x length)/2
Convert the square cm to square m by dividing by 10000
Print area in sq m, this uses decimals
computer the aspect ratio of the kite. Aspect ratio is width/length
If the aspect ratio is greater than 1 print a warning to user that a lower ratio would provide more stability.
Output:
Output is self documenting
Shows input with labels, then the output
Pseudocode for part 1:
int width
int length
float areaCM
float areaM
int ratio
begin main function
print "enter width of kite"
input width
print "enter length of kite"
input length
print "your kite has a width of: " width " and length of: " length
areaCM = width x length / 2
areaM = areaCM / 10000
ratio = width / length
if ratio >= 1
"Warning, a lower aspect ratio would provide more stability"
else
"nice aspect ratio"
print "your kite's area in square meters is: " areaM
|