Past-paper question · 2022 May-June · Paper 21 · Q5(a)

Question 5(a) 2022 · May-June · Paper 21 · 5 marks

Original past-paper question for 5(A)
Original past-paper question for 5(A)
Reveal official mark-scheme answer Official mark-scheme answer for 5(A)

Official answer for Question 5

Part (a)

✓
One mark per mark point, max five

Question 5

✓
MP1
✓
correct Counter and Limit columns
✓
MP2
✓
correct Value column
✓
MP3
✓
correct First column
✓
MP4
✓
correct Last column
✓
MP5
✓
correct OUTPUT
✓
Counter
✓
Value
✓
First
✓
Last
✓
Limit
✓
OUTPUT
✓
0
✓
0

Question 8

Question 1

Question 66

Question 2

✓
606

Question 6

Question 6

✓
606

Question 3

✓
6226

Question 4

✓
8448

Question 5

✓
642

Question 6

Question 2

Question 6

✓
747

Question 7

Question 7

✓
747

Question 7

Question 77

Question 8

✓
121

Question 1

Question 1

✓
121
✓
0478/21
✓
Cambridge IGCSE – Mark Scheme
✓
May/June 2022
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 0478_s22_ms_21.pdf →

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

[5]

Question 11

Topic relevance

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

Keep practising this topic