Question 2

OCR B (MEI) Further Maths June 2017 Decision mathematics 1 (4771-01)Older specification8 marks

On the specification

(i)
AA1-A5 Modelling with Algorithms: Algorithms, basic ideas and complexity
(ii)
AA1-A5 Modelling with Algorithms: Algorithms, basic ideas and complexity
(iii)
AA1-A5 Modelling with Algorithms: Algorithms, basic ideas and complexity
Question text

2 The following is an algorithm for ‘shop subtraction’. It applies to two whole numbers, each between 0 and 999. 10 Let P be the smaller number 20 Let M be the larger number 30 Let C be 0 40 If P + C + 100 > M then goto 70 50 Let C = C + 100 60 Goto 40 70 If P + C + 10 > M then goto 100 80 Let C = C + 10 90 Goto 70 100 If P + C + 1 > M then goto 130 110 Let C = C + 1 120 Goto 100 130 Print ‘The answer is’ C (i) Apply the algorithm to the numbers 112 and 250. Show the steps as you apply them and give the answer. [4] (ii) Show how to modify the algorithm so that it can be applied to numbers between 0 and 9999. [3] (iii) What is the connection between the algorithm and giving change for a purchase made in a shop? [1]