Question 2(a) 2022 · October-November · Paper 23 · 6 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (a)
Question 6
Question 50
Show text version of question
Question 2
Part (a)
Question 2
An algorithm has been written to:
- set all 50 elements of the array Reading[1:50] to zero
- input values between 35 and 50 inclusive
- end the process when an input of –1 is made or 50 valid numbers have been entered
- reject all other values
- count the number of times each valid value is input
- output the number of times each value has been input, starting with the lowest value.
Part (a)
Complete the pseudocode algorithm:
01 FOR Count 1 TO ....................................................................................................
02 Reading[Count] 0
03 NEXT Count
04 Count 1
05 OUTPUT "Please enter next reading "
06 INPUT Value
07 REPEAT
08 IF Value < 35 OR .................................................................................................
09 THEN
10 OUTPUT "Reading out of range"
11 ELSE
12 Reading[Value] .......................................................................................
13 Count = Count + 1
14 ENDIF
15 IF Count <= 50
16 THEN
17 OUTPUT "Please enter next reading "
18 .................................................................................................................................
19 ENDIF
20 UNTIL Value = -1 OR Count > 50
21 Count 35
22 REPEAT
23 OUTPUT "There are ", ....................................................................., " readings of ", Count
24 Count ...................................................................................................................
25 UNTIL Count > 50
Question 9
Why this question appears here
98% assigned-topic match · Algorithm design and problem-solving
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 2210_w22_qp_23.pdf
