Past-paper question · 2014 May-June · Paper 23 · Q5

Question 5 2014 · May-June · Paper 23 · 20 marks

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

Official answer for Question 5

(i)

✓
List
✓
(List[y] >
✓
x
✓
ThisValue
✓
y
✓
List[y]
✓
ThisValue)
✓
AND (y > 0)

[1] [2] [3][4]

✓
–
✓
–
✓
–
✓
–
✓
–

Question 56

Question 23

Question 67

Question 12

Mark scheme 9691_s14_ms_23.pdf →

Show text version of question

Question 5

Raul copied the following pseudocode from a computing textbook. He wants to find out what it does.

(i)

Dry run the pseudocode using the trace table.

FOR x 2 TO 4 ThisValue List[x] y x – 1 WHILE (List[y] > ThisValue) AND (y > 0) List[y + 1] List[y] y y - 1 ENDWHILE List[y + 1] ThisValue ENDFOR

List (List[y] > ThisValue) x ThisValue y List[y] AND (y > 0)

[1]
[2]
[3]
[4]

− − − − − 56 23 67 12

2 23 1 56 TRUE

[9]

(ii)

What does this pseudocode do?

[1]

reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.

Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.

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 9691_s14_qp_23.pdf

Keep practising this topic