-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuestion 19 past paper 1.txt
57 lines (34 loc) · 1.27 KB
/
Question 19 past paper 1.txt
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
56
57
"A software application prompts the user to input two numbers. After the user provides the two
numbers, the application proceeds to invoke a module to compute the average of the two
inputs. Following the calculation of the average, another module is invoked to determine
whether the average exceeds 75. If the average surpasses 75, a message reading
'Congratulations, you are in the top 5' is displayed."
Construct a flowchart for each module to be invoked. Ensure that the flowcharts accurately
depict the logic outlined in the scenario
start
declaration
num numberOne
num numberTwo
num passThreshhold = 75
output "enter a number"
input numberOne
output "enter a number"
input numberTwo
//call method
CalculateAverage(numberOne, numberTwo)
//call method
CheckAverage(average)
stop
num CalculateAverage(numberOne, numberTwo)
declaration
num average
average = (numberOne + numberTwo) / 2
return average
void CheckAverage(average)
// loop to check if average is higher than or = to pass threshhold
if (average >= passThreshhold)
output "Congratulations, you are in the top 5' is displayed."
else
output "Unfortunately you failed"
endif
return