Question 5 2014 · May-June · Paper 23 · 20 marks
Reveal official mark-scheme answer
Official answer for Question 5
(i)
[1] [2] [3][4]
Question 56
Question 23
Question 67
Question 12
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)
− − − − − 56 23 67 12
2 23 1 56 TRUE
(ii)
What does this pseudocode do?
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.
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
