Past-paper question · 2025 May-June · Paper 22 · Q5(a)

Question 5(a) 2025 · May-June · Paper 22 · 5 marks

Original past-paper question for 5(A)
Original past-paper question for 5(A)
Reveal official mark-scheme answer Official mark-scheme answer for 5(A)

Official answer for Question 5

Part (a)

✓
One mark per mark point

Question 5

✓
•
✓
Line 01 / DECLARE Names : ARRAY[1:500] OF REAL
✓
should be DECLARE Names : ARRAY[1:500] OF STRING
✓
•
✓
Line 09 / Total 100
✓
should be Total 0
✓
•
✓
Line 11 / INPUT Names[Index]
✓
should be INPUT Names[Counter]
✓
•
✓
Line 13 / Total Counter + Heights[Counter]
✓
should be Total Total + Heights[Counter]
✓
•
✓
Line 20 / OUTPUT "The shortest height is ", Heights
✓
should be OUTPUT "The shortest height is ", Shortest
✓
or OUTPUT "The shortest height is ", Heights[Index]
✓
01
✓
DECLARE Names : ARRAY[1:500] OF STRING
✓
02
✓
DECLARE Heights : ARRAY[1:500] OF REAL
✓
03
✓
DECLARE Shortest : REAL
✓
04
✓
DECLARE Total : REAL
✓
05
✓
DECLARE Counter : INTEGER
✓
06
✓
DECLARE Index : INTEGER
✓
Shortest 500
✓
07
✓
Index 0
✓
08
✓
Total 0
✓
09
✓
FOR Counter 1 TO 500

Question 10

Question 11

✓
INPUT Names[Counter]

Question 12

✓
INPUT Heights[Counter]
✓
Total Total + Heights[Counter]

Question 13

Question 14

✓
IF Heights[Counter] < Shortest

Question 15

✓
THEN
✓
Shortest Heights[Counter]

Question 16

✓
Index Counter

Question 17

Question 18

✓
ENDIF

Question 19

✓
NEXT Counter

Question 20

✓
OUTPUT "The shortest height is ", Shortest

Question 21

✓
OUTPUT "The shortest person is ", Names[Index]

Question 22

✓
OUTPUT "The average height is ", Total / 500

Mark scheme 2210_s25_ms_22.pdf →

Show text version of question

Question 5

Part (a)

Question 5

This pseudocode algorithm should allow 500 names of people and their heights to be entered and

stored in two one-dimensional (1D) arrays. The name of a person and the height of that person are in the same index in both the Names[] and the Heights[] arrays.

The algorithm performs as follows:

  • at the start, the following data is entered:
  • ◦ name of person ◦ height of person in cm

  • the data is stored in the relevant arrays
  • the heights of the people are totalled
  • the shortest person is found
  • at the end, the following is output:

◦ name of shortest person ◦ height of shortest person ◦ average height of all 500 people.

01 DECLARE Names : ARRAY[1:500] OF REAL 02 DECLARE Heights : ARRAY[1:500] OF REAL 03 DECLARE Shortest : REAL 04 DECLARE Total : REAL 05 DECLARE Counter : INTEGER 06 DECLARE Index : INTEGER 07 Shortest 500 08 Index 0 09 Total 100 10 FOR Counter 1 TO 500 11 INPUT Names[Index] 12 INPUT Heights[Counter] 13 Total Counter + Heights[Counter] 14 IF Heights[Counter] < Shortest 15 THEN 16 Shortest Heights[Counter] 17 Index Counter 18 ENDIF 19 NEXT Counter 20 OUTPUT "The shortest height is ", Heights 21 OUTPUT "The shortest person is ", Names[Index] 22 OUTPUT "The average height is ", Total / 500

Question 5

Part (a)

Identify the line numbers of five errors in the pseudocode and suggest a correction for each

error.

Error 1 line number ..................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 line number ..................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 line number ..................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 line number ..................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 5 line number ..................................

Correction .................................................................................................................................

...................................................................................................................................................

[5]
Topic relevance

Why this question appears here

98% assigned-topic match · Algorithm design and problem-solving

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 2210_s25_qp_22.pdf

Keep practising this topic