Two algorithms are shown.
Two algorithms are shown.
Algorithm 1 Algorithm 2
Line 10 Input P Line 10 Input P
Line 20 Input R Line 20 Input R
Line 30 Input T Line 30 Input T
Line 40 Let I = (P * R * T) / 100 Line 40 Let A = P
Line 50 Let A = P + I Line 50 K = 0
Line 60 Let M = A / (12 * T) Line 60 Let K = K + 1
Line 70 Print M Line 70 Let I = (A * R) / 100
Line 80 Stop Line 80 Let A = A + I
Line 90 If K < T then go to Line 60
Line 100 Let M = A / (12 * T)
Line 110 Print M
Line 120 Stop
(a) Trace Algorithm 1 where the input values are P = 400, R = 5 and T = 3: +6 points
___A____ ____I____ ___M___ ___P____ ___R___ ___T____ _(Print)___
LINE 10 _____________________________________________________________________
LINE 20 _____________________________________________________________________
LINE 30 _____________________________________________________________________
LINE 40 _____________________________________________________________________
LINE 50 _____________________________________________________________________
LINE 60 _____________________________________________________________________
LINE 70 _____________________________________________________________________
LINE 80 _____________________________________________________________________
(b) Trace Algorithm 2 where the input values are P = 400, R = 5 and T = 3: +14 points
___A___ ___I___ ___M___ ___P___ ___R___ ___T___ ___K___ _(Print)__
LINE 10 _____________________________________________________________________
LINE 20 _____________________________________________________________________
LINE 30 _____________________________________________________________________
LINE 40 _____________________________________________________________________
LINE 50 _____________________________________________________________________
LINE 60 _____________________________________________________________________
LINE 70 _____________________________________________________________________
LINE 80 _____________________________________________________________________
LINE 90 _____________________________________________________________________
LINE 100 _____________________________________________________________________
LINE 110 _____________________________________________________________________
LINE 120 _____________________________________________________________________