Quelpr

CAPE Computer Science Unit 1 · 2012 · Paper 2 · Question 3(b)(i)

Two iterative algorithms are provided (Algorithm 1 uses a FOR loop from 0 to 15, Algorithm 2 uses a WHILE loop reading input until a sentinel value 999).

Which of the algorithms illustrates bounded iteration? Justify your answer.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 3(a)Explain the role of an algorithm in the problem-solving process.[2 marks]
  2. 3(b)(ii)Which of the algorithms illustrates unbounded iteration? Justify your answer.[3 marks]
  3. 3(c)(i)Write an algorithm to find and print the number of students that voted for EACH of the colours: red, blue, green.[5 marks]
  4. 3(c)(ii)Write an algorithm to find and print the TOTAL number of students that voted for red, blue or green.[5 marks]
  5. 3(d)Write an algorithm that uses iteration to find the sum of all multiples of 4 and all multiples of 7 between m (inclusive) and n (inclusive) where m and n are…[7 marks]

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