Past-paper question · 2020 October-November · Paper 22 · Q5(a)

Question 5(a) 2020 · October-November · Paper 22 · 25 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)

Question 5

✓
Num
✓
Num
✓
Num
✓
Num
✓
Num
✓
Flag
✓
Count
✓
Store
✓
[0]
[1]
[2]
[3]
[4]

Question 45

Question 56

Question 30

Question 12

Question 15

✓
0
✓
0

Question 45

Question 56

Question 1

Question 45

Question 1

Question 2

Question 3

Question 12

Question 15

Question 12

✓
0
✓
0

Question 1

Question 2

Question 3

✓
One mark – Flag column
✓
One mark – Count column
✓
One mark – Num[0] and Num[1] columns
✓
One mark – Num[2], Num[3] and Num[4] columns
✓
One mark – Store column

Mark scheme 2210_w20_ms_22.pdf →

Show text version of question

Question 5

Part (a)

Question 5

This pseudocode represents an algorithm.

REPEAT Flag 0 FOR Count 0 to 3 IF Num[Count] < Num[Count + 1] THEN Store Num[Count] Num[Count] Num[Count + 1] Num[Count + 1] Store Flag 1 ENDIF NEXT Count UNTIL Flag = 0

Part (a)

The contents of the array at the start of the algorithm are:

Num[0] Num[1] Num[2] Num[3] Num[4] 45 56 30 12 15

Complete the trace table for the algorithm using the data given in the array.

Flag Count Num[0] Num[1] Num[2] Num[3] Num[4] Store 45 56 30 12 15

[5]
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 2210_w20_qp_22.pdf

Keep practising this topic