Question 5(a) 2022 · May-June · Paper 21 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 5
Part (a)
Question 5
Question 8
Question 1
Question 66
Question 2
Question 6
Question 6
Question 3
Question 4
Question 5
Question 6
Question 2
Question 6
Question 7
Question 7
Question 7
Question 77
Question 8
Question 1
Question 1
Show text version of question
Question 5
Part (a)
Question 5
The pseudocode represents an algorithm.
The pre-defined function DIV gives the value of the result of integer division. For example, Y = 9 DIV 4 gives the value Y = 2
The pre-defined function MOD gives the value of the remainder of integer division. For example, R = 9 MOD 4 gives the value R = 1
First ← 0 Last ← 0 INPUT Limit FOR Counter ← 1 TO Limit INPUT Value IF Value >= 100 THEN IF Value < 1000 THEN First ← Value DIV 100 Last ←Value MOD 10 IF First = Last THEN OUTPUT Value ENDIF ENDIF ENDIF NEXT Counter
Part (a)
Complete the trace table for the algorithm using this input data:
8, 66, 606, 6226, 8448, 642, 747, 77, 121
Counter Value First Last Limit OUTPUT
Question 11
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_21.pdf
