The one-dimensional (1D) array CompetitorName[] contains the names of 25 competitors in a tournament that includes five events. Another two-dimensional (2D) array CompetitorScore[] contains the points scored by each competitor in the five events. The first dimension of this array contains the index of the competitor from CompetitorName[] and the second dimension contains their scores. Each competitor receives a score out of 100 for each event. These scores are manually entered into CompetitorScore[] Medals are awarded to the competitor or the competitors who have: • the highest points scored in each of the five events • the highest total points scored for all five events. The one-dimensional (1D) array Points[] stores the total number of points scored for each competitor. Write a program that meets the following requirements: • takes as input, valid scores (between 0 and 100), for each competitor in each of the five events • calculates the highest points scored for each event • outputs the names of the competitors who receive a medal for the highest points scored • calculates the highest total points scored for the five events • outputs the names of the competitors with the highest total points scored for the five events. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays or variables. All inputs and outputs must contain suitable messages.
- The one-dimensional (1D) array CompetitorName[] contains the names of 25 competitors in a tournament that includes five events. Another two-dimensional (2D) array CompetitorScore[] contains the points scored by each competitor in the five events. The first dimension of this array contains the index of the competitor from CompetitorName[] and the second dimension contains their scores. Each competitor receives a score out of 100 for each event. These scores are manually entered into CompetitorScore[] Medals are awarded to the competitor or the competitors who have: • the highest points scored in each of the five events • the highest total points scored for all five events. The one-dimensional (1D) array Points[] stores the total number of points scored for each competitor. Write a program that meets the following requirements: • takes as input, valid scores (between 0 and 100), for each competitor in each of the five events • calculates the highest points scored for each event • outputs the names of the competitors who receive a medal for the highest points scored • calculates the highest total points scored for the five events • outputs the names of the competitors with the highest total points scored for the five events. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays or variables. All inputs and outputs must contain suitable messages.[15]
Mark scheme
Marking points from the official mark scheme (May/June 2025). The mark or mark type is shown in brackets.
- [9] AO2: Apply knowledge and understanding of the principles and concepts of computer science to a given context, including the analysis and design of computational or programming problems
- [6] AO3: Provide solutions to problems by: evaluating computer systems, making reasoned judgements, presenting conclusions
- [Data Structures] Required arrays or lists: CompetitorName, CompetitorScore, Points
- [Requirement 1] Inputs and validates the points for each event for each competitor (nested iteration, iteration, input, output)
- [Requirement 2] Finds and outputs the name of the competitors with the highest score for each event (nested iteration, output and selection)
- [Requirement 3] Totals the score for each competitor, finds and outputs the names with the highest score for all five events(iteration, totalling, output and selection)
- [General] Meaningful identifier names and appropriate data structures (variables, constants and the given arrays) to store all the data required.
- [General] Code includes comments to explain how code works.
- [General] All inputs and outputs contain suitable messages.
- Example Pseudocode: DECLARE Points : ARRAY [1 : 25] OF REAL DECLARE Highest : ARRAY [1 : 5] OF REAL Winner ← 0 Max ← 0 FOR Count ← 1 TO 25 //initialising array Points [Count] ← 0 NEXT Count FOR Count ← 1 TO 5 //initialising array Highest [Count] ← 0 NEXT Count // Requirement 1: Input and validate scores for each competitor in each event FOR Event ← 1 TO 5 FOR X ← 1 TO 25 // loops through each entrant REPEAT OUTPUT "Please enter a score between 0 and 100 for Competitor ", X, " for event ", Event INPUT Score UNTIL Score >= 0 AND Score <= 100 //validates score CompetitorScore[X, Event] ← Score //stores score for each Event Points [X] ← Points[X] + Score //can total score here NEXT X NEXT Event // Requirement 2: Calculate highest score for each event and output medallist names FOR Event ← 1 TO 5 FOR X ← 1 TO 25 IF CompetitorScore[X, Event] > Highest[Event] THEN //calculates the highest score Highest [Event] = CompetitorScore[X, Event] ENDIF NEXT X NEXT Event FOR Event ← 1 TO 5 OUTPUT "The winner of a medal for the highest score in event ", Event FOR X ← 1 TO 25 IF CompetitorScore[X, Event] = Highest[Event] THEN OUTPUT CompetitorName [X] ENDIF NEXT X NEXT Event // Requirement 3: Calculate highest total score and output medallist names FOR X ← 1 TO 25 //calculates the highest points scored for the five events IF Points [X] > Max THEN Max ← Points [X] ENDIF NEXT X OUTPUT "The competitors with the highest total score for the five events are:" FOR X ← 1 TO 25 IF Points [X] = Max THEN OUTPUT CompetitorName [X] ENDIF NEXT X
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →