Past-paper question · 2015 October-November · Paper 22 · Q5(b)

Question 5(b) 2015 · October-November · Paper 22 · 5 marks

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

Official answer for Question 5

Part (b)

Part (b)

✓
Identifier
✓
Data Type
✓
Description
✓
Num
✓
N
✓
INTEGER
✓
The number of numbers in the list
✓
Loop counter // The number of ‘passes’
✓
i
✓
INTEGER
✓
up through the list
✓
j
✓
INTEGER
✓
The index // position in the array
✓
Description must imply/states the
✓
Temp
✓
INTEGER
✓
‘swapping’ operation
✓
Mark as follows:
✓
INTEGER × 4
[1]
✓
One mark per description
[4]

Mark scheme 9608_w15_ms_22.pdf →

Show text version of question

Question 5

Part (b)

Question 5

A program is to process a set of integers.

The integers are stored in an array, Num. The first N elements are to be processed.

The pseudocode for this program is shown below:

FOR i ←1 TO (N - 1) j ←

Question 1

REPEAT IF Num[j] > Num[j + 1] THEN Temp ← Num[j] Num[j] ← Num[j + 1] Num[j + 1] Temp ← ENDIF j ← j + 1 UNTIL j = (N – i + 1) ENDFOR

Part (b)

Complete the identifier table documenting the use of each of the variables.

Identifier Data type Description

Num ARRAY[1:100] OF INTEGER The array of numbers.

N

i

j

Temp

[5]

Question 13

Topic relevance

Why this question appears here

82% assigned-topic match · Programming › Constructs

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 9608_w15_qp_22.pdf

Keep practising this topic