Study the algorithm below and answer the questions that follow.
(NB. In this algorithm <= implies less than or equal to)
Set counter to zero
Begin
Input mark
If counter <=4 then
Add 1 to counter
Add mark to sum
End if
Until mark =-100
Print sum
Print counter
(i)Complete the trace table for the algorithm using the following set of marks:
25, 20, 23, 24, 20, 30,-100
MARK SUM COUNTER
0 0
25 25 1
20 45 2
23 68 3
24 92 4
20 112 5
30 112 5
-100 112 5
(ii)What is the purpose of the algorithm?
-to find the sum of the 5 marks