Ask your own question, for FREE!
Computer Science 21 Online
OpenStudy (hari5719):

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

OpenStudy (anonymous):

Total should increase by the mark Count should increase by one

OpenStudy (anonymous):

And the mark is greater than the max mark, it will become the new max mark

OpenStudy (anonymous):

The mean mark will be the total divided by the count

OpenStudy (anonymous):

@hari5719 Does it make sense?

OpenStudy (hari5719):

oh i get it its been a while since i touched proggramming its pellet easy i get it thax @wio

OpenStudy (hari5719):

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

OpenStudy (hari5719):

@wio is it right well the last part is 13 output “Maximum mark =”, MaxMark 14 output meanmark

OpenStudy (hari5719):

these question marks arent suppose to be there ok @wio

OpenStudy (hari5719):

@ wio u der is it right and is the third variable initialization right total

OpenStudy (hari5719):

@wio pls answer

OpenStudy (anonymous):

I think so

OpenStudy (hari5719):

so there must be a total =0 at the start @wio ??????????

OpenStudy (anonymous):

yeah, total = 0

OpenStudy (hari5719):

but it says repeat ???????????? @wio

OpenStudy (anonymous):

No, for the top, total=0

OpenStudy (anonymous):

For the second one, total = total + nextmark

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!