Question 4(a) 2022 · May-June · Paper 23 · 7 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (a)
Question 7
Question 5
Question 1
Question 2
Question 9
Question 3
Question 2
Question 2
Question 5
Question 3
Question 5
Question 1
Question 3
Question 2
Question 8
Question 4
Question 2
Question 10
Question 5
Question 2
Question 7
Question 3
Question 7
Question 2
Question 5
Question 1
Question 7
Show text version of question
Question 4
Part (a)
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 (a)
Complete the trace table for the algorithm using this input data:
5, 9, 5, 8, 10, 7
Store In Logic Test Number Count Limit Out OUTPUT [Count]
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 0478_s22_qp_23.pdf
