Note AcademyNote Academy

Computer Science · May / June 2025 · Paper 21 · Question 11

0478

As printed in the paper

The question as text

The one-dimensional (1D) array Ž„à ‘¹‘Ž™‚ƒ„ ‡ˆ contains the names of 25 competitors in a tournament that includes five events. Another two-dimensional (2D) array Ž„à ‘¹‘Ž™½áŽ™ ‡ˆ contains the points scored by each competitor in the five events. The first dimension of this array contains the index of the competitor from Ž„à ‘¹‘Ž™‚ƒ„ ‡ˆ and the second dimension contains their scores. Each competitor receives a score out of 100 for each event. These scores are manually entered into Ž„à ‘¹‘Ž™½áŽ™ ‡ˆ 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 –޹‘†‡ˆ 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.

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme

Marks are available for:

AO2 (maximum 9 marks)
AO3 (maximum 6 marks)

Data Structures required names shown underlined must be used as given in the scenario Arrays or lists

CompetitorName, CompetitorScore, Points

Requirements (techniques)

R1 inputs and validates the points for each event for each competitor (nested iteration, iteration, input, output) R2 finds and outputs the name of the competitors with the highest score for each event (nested iteration, output and selection)

R3 totals the score for each competitor, finds and outputs the names with the highest score for all five events(iteration, totalling, output and selection)

Example 15-mark answer in pseudocode.

// meaningful identifier names and appropriate data structures (variables, constants and the given arrays) to store all the data required. Note that candidates did not need to declare any arrays or variables as stated in the question paper. 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

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

FOR Event ← 1 TO 5

For X ← 1 TO 25

IF CompetitorScore[X, Event] > Highest[Event] //calculates the highest score THEN

Highest[Event] = CompetitorScore[X, Event]

ENDIF

NEXT X

NEXT Event

FOR Event ← 1 TO 5 //outputs the names of competitors with the highest score

For X ← 1 TO 25

OUTPUT "The winner of a medal for the highest score in event ", Event

IF CompetitorScore[X, Event] = Highest[Event]

THEN

OUTPUT CompetitorName[X]

ENDIF

NEXT X

NEXT Event

Requirement 3

//points may be calculated here

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

//outputs the names of the competitors with the highest score

OUTPUT "The competitors with the highest score for the five events"

For X ← 1 TO 25

IF Points[X] = Max

THEN

OUTPUT CompetitorName[X]

ENDIF

NEXT X

Marking Instructions in italics

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

1–3

4–6

7–9

0

No creditable

At least one programming

Some programming techniques

The range of programming response.

technique has been used.

used are appropriate to the

techniques used is appropriate Any use of selection, iteration,

problem.

to the problem.

counting, totalling, input and

More than one technique seen

All criteria stated for the output.

applied to the scenario, check

scenario have been covered by the list of techniques needed.

the use of appropriate programming techniques, check the list of techniques needed.

Some data has been stored but

Some of the data structures

The data structures chosen are not appropriately.

chosen are appropriate and

appropriate and store all the Any use of variables or arrays

store some of the data

data required.

or other language dependent

required.

The data structures used store data structures e.g. Python

More than one data structure

all the data required by the lists.

used to store data required by

scenario.

the scenario.

Marking Instructions in italics

AO3: Provide solutions to problems by:

evaluating computer systems
making reasoned judgements
presenting conclusions

1–2

3–4

5–6

0

No creditable

Program seen without relevant

Program seen with some

The program has been fully response.

comments.

relevant comment(s).

commented.

Some identifier names used

The majority of identifiers used

Suitable identifiers with names are appropriate.

are appropriately named.

meaningful to their purpose Some of the data structures

Most of the data structures

have been used throughout. used have meaningful names.

used have meaningful names.

All the data structures used have meaningful names. The solution is illogical.

The solution contains parts that

The program is in a logical may be illogical.

order.

The solution is inaccurate in

The solution contains parts that

The solution is accurate. many places.

are inaccurate.

Solution logically performs all Solution contains few lines of

Solution contains lines of code

the tasks given in the scenario. code with errors that attempt to

with some errors that logically

Ignore minor syntax errors. perform a task given in the

perform tasks given in the

scenario.

scenario. Ignore minor syntax

errors.

The solution attempts at least

The solution meets most of the

The solution meets all the one of the requirements.

requirements.

requirements given in the Solution contains lines of code

Solution contains lines of code

question.

that attempt at least one task

that perform most tasks given

Solution performs all the tasks given in the scenario.

in the scenario.

given in the scenario.

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.