1. Below is an incomplete algorithm which is intended to output the maximum mark and mean mark of a set of examination marks. 1 set MaxMark = 0 2 set Count = 0 3 set ………………………………………… 4 repeat 5 input NextMark 6 set Total = ………………………………………… 7 set Count = ………………………………………… 8 if NextMark > MaxMark then 9 …………………………………………………………………………………… 10 endif 11 until (NextMark < 0) 12 set MeanMark = Total / Count 13 output “Maximum mark =”, MaxMark 14 output ………………………………………… Fill the missing parts
Total should increase by the mark Count should increase by one
And the mark is greater than the max mark, it will become the new max mark
The mean mark will be the total divided by the count
@hari5719 Does it make sense?
oh i get it its been a while since i touched proggramming its pellet easy i get it thax @wio
set MaxMark = 0 2 set Count = 0 3 set total = 0 4 repeat 5 input NextMark 6 set Total = toatal+nextmark 7 set Count = count +1 8 if NextMark > MaxMark then 9 maxmark=nextmark 10 endif 11 until (NextMark < 0) 12 set MeanMark = Total / Count 13 output “Maximum mark =”, MaxMark 14 output mean mark
@wio is it right well the last part is 13 output “Maximum mark =”, MaxMark 14 output meanmark
these question marks arent suppose to be there ok @wio
@ wio u der is it right and is the third variable initialization right total
@wio pls answer
I think so
so there must be a total =0 at the start @wio ??????????
yeah, total = 0
but it says repeat ???????????? @wio
No, for the top, total=0
For the second one, total = total + nextmark
Join our real-time social learning platform and learn together with your friends!