Quelpr

CAPE Computer Science Unit 1 · 2014 · Paper 2 · Question 4(c)

Read the following algorithm and answer the questions that follow: read x sum1 = 1 while x < 10 do sum1 = sum1 * (x-1) print sum1 read x endwhile print 'Sum=', sum1

What would the algorithm print given the line of input data below? (Clearly show how you arrived at your answer.) 5 3 2 6 12 4

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 4(a)(i)Construct an algorithm to print the product name, the discount for that product followed by the new price.[6 marks]
  2. 4(a)(ii)Construct an algorithm to print the TOTAL amount of product discounts overall. If the total amount of discounts is greater than…[6 marks]
  3. 4(b)Construct a flow chart to represent the algorithm given in 4(a) above.[6 marks]

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