AQA D1 2006 January — Question 6

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2006
SessionJanuary
TopicSorting Algorithms

6 Two algorithms are shown. \section*{Algorithm 1}
Line 10Input \(P\)
Line 20Input \(R\)
Line 30Input \(T\)
Line 40Let \(I = ( P * R * T ) / 100\)
Line 50Let \(A = P + I\)
Line 60Let \(M = A / ( 12 * T )\)
Line 70Print \(M\)
Line 80Stop
\section*{Algorithm 2}
Line 10Input \(P\)
Line 20Input \(R\)
Line 30Input \(T\)
Line 40Let \(A = P\)
Line 50\(K = 0\)
Line 60Let \(K = K + 1\)
Line 70Let \(I = ( A * R ) / 100\)
Line 80Let \(A = A + I\)
Line 90If \(K < T\) then goto Line 60
Line 100Let \(M = A / ( 12 * T )\)
Line 110Print \(M\)
Line 120Stop
In the case where the input values are \(P = 400 , R = 5\) and \(T = 3\) :
  1. trace Algorithm 1;
  2. trace Algorithm 2.