Question 2(b) 2022 · October-November · Paper 23 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (b)
Question 3
- line 21 set Count to 50 / Count 50
- line 24 subtract 1 from Count / Count Count –1
- line 25 check for Count equal to 34 / check for Count less than 35 / UNTIL Count = 34 / UNTIL Count < 35
Show text version of question
Question 2
Part (b)
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 (b)
Describe how the algorithm could be changed to output the number of times each value has
been input, starting with the highest value.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Question 10
Why this question appears here
80% assigned-topic match · Programming › Programming concepts
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 0478_w22_qp_23.pdf
