Answer to Question #256689 in Algorithms for Dion Martins

Question #256689

Do the necessary planning (IPO) and write an algorithm in pseudo code for the following:


1 An unknown number of toddlers are taking part in a competition. 5 adjudicators will give each competitor a mark out of 10. These marks are added together to get a mark out of 100. Write a complete C++ program to do the following

 Enter the competitor’s number. (-1 is entered to terminate the input.)

 Enter 10 marks out of 10 for each competitor.

 Calculate the total mark.

 Compare it to the marks of previous competitors to obtain the highest mark.

 Enter the number of the following competitor.

 When all data have been processed, display the number of the competitor with the highest mark as well as the current competitor’s mark.


1
Expert's answer
2021-10-31T12:08:47-0400

int n \\ number of competitors

int array Sum(n) \\ array of total marks

{

for j from 1 to n

display 'Enter the competitor’s number':

int x

if x=-1 then

terminate input


array int A(10) \\ marks for competitor

Sum[x]=0 \\ initial total mark

display 'Enter mark out of 10 for competitor:'

{

for i from 1 to 10

A[i]=a\\ enter 10 marks

int a

Sum[x]=Sum[x]+A[i] \\ calculate total mark

}

if x>1 then

M=max(Sum[x],Sum[x-1]) \\ compare to the mark of previous competitor

}

display 'the number of the competitor with the highest mark as well as the current competitor’s mark:'



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS