You are given two parallel arrays that have already been loa

You are given two parallel arrays that have already been loaded with data. The parallel arrays are: names [] - which includes all Student names and score[] - which contains the exam score each student has score received. Sample data for these parallel arrays are: You can assume that both arrays already exist and have been loaded with data. Write the pseudo code to calculate and output to the screen the name and the score of the student with the highest number of score.

Solution

Here is the Pseudo code for you:

Algorithm FindHighestScorerDetails(Name[1..n], Score[1..n])
Input: An array of Names of size n, and an array of Scores of size n.
Output: Prints the Name and Score of the highest scorer.
Description: Given two arrays, one for names, and the other for scores, the algorithm
finds the one who scored the highest, and will display their name along with their scores.

highScoreIndex = 1;
for i = 2 : n:
   if Score[i] > Score[highScoreIndex]:
       highScoreIndex = i;
Print Name[highScoreIndex], Score[highScoreIndex]

 You are given two parallel arrays that have already been loaded with data. The parallel arrays are: names [] - which includes all Student names and score[] - w

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site