AQA D1 2013 June — Question 6

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2013
SessionJune
TopicFixed Point Iteration

6 A student is tracing the following algorithm. The function INT gives the integer part of any number, eg \(\operatorname { INT } ( 2.3 ) = 2\) and \(\operatorname { INT } ( 6.7 ) = 6\). Line 10 Input \(A , B\)
Line \(20 \quad\) Let \(C = \operatorname { INT } ( A \div B )\)
Line 30 Let \(D = B \times C\)
Line \(40 \quad\) Let \(E = A - D\)
Line 50 If \(E = 0\) then go to Line 90
Line 60 Let \(A = B\)
Line \(70 \quad\) Let \(B = E\)
Line 80 Go to Line 20
Line 90 Print \(B\)
Line 100 Stop
  1. Trace the algorithm when the input values are:
    1. \(A = 36\) and \(B = 16\);
    2. \(A = 11\) and \(B = 7\).
  2. State the purpose of the algorithm.