Question 4(c) 2022 · May-June · Paper 23 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (c)
Question 3
Show text version of question
Question 4
Part (c)
Question 4
The pseudocode represents an algorithm.
The pre-defined function DIV gives the value of the result of integer division. For example, Y = 11 DIV 4 gives the value Y = 2
Count ←0 INPUT Limit FOR In ← ← 1 TO Limit Logic ← TRUE Test 2 INPUT Number REPEAT IF Number / Test = Number DIV Test
← THEN Logic FALSE ELSE Test ←Test + 1 ENDIF UNTIL NOT Logic OR Test >= Number DIV 2 IF Logic
← THEN
← Store[Count] Number Count Count + 1 ENDIF NEXT In FOR Out ← 0 TO Count - 1 OUTPUT Store[Out] NEXT Out
Part (c)
This algorithm only works for numbers that are 3 or greater.
Describe how you could change this algorithm to make sure that only numbers that are 3 or greater are entered. Any pseudocode statements used in your answer must be fully described.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Question 10
Why this question appears here
73% 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 0478_s22_qp_23.pdf
