Quelpr

CAPE Computer Science Unit 1 · 2011 · Paper 2 · Question 4(b)

Trace through the execution of the given algorithm and draw the exact output generated, using a dash '-' to represent spaces printed by printSpaces(n).

This question uses a figure or table from the paper — you'll see it when you practise.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 4(a)State THREE properties of a well-designed algorithm.[3 marks]
  2. 4(c)(i)Write an algorithm that uses iteration to print the sum of ALL multiples of 11 (integers) between 0 and 5 000, inclusive.[8 marks]
  3. 4(c)(ii)Indicate whether 'bounded' or 'unbounded' iteration was used in your response for 4(c)(i) and state ONE reason for its use.[3 marks]

More practice: the rest of this paper · more Algorithm Verification and Development questions · all CAPE Computer Science Unit 1 past papers