Past-paper question · 2024 May-June · Paper 23 · Q4(a)

Question 4(a) 2024 · May-June · Paper 23 · 4 marks

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

Official answer for Question 4

Part (a)

✓
One mark per mark point, max four

Question 4

✓
Line 01 / DECLARE People : ARRAY[1:50, 1:3] OF REAL
✓
should be DECLARE People : ARRAY[1:50, 1:3] OF STRING
✓
Line 10 / Count 100
✓
should be Count 1
✓
Line 12 / CASE OF
✓
should be REPEAT
✓
Line 27 / UNTIL NOT Count
✓
should be UNTIL NOT Continue // UNTIL Continue = FALSE
✓
Correct algorithm:
✓
01
✓
DECLARE People : ARRAY[1:50, 1:3] OF STRING
✓
02
✓
DECLARE Count : INTEGER
✓
03
✓
DECLARE Response : CHAR
✓
04
✓
DECLARE Continue : BOOLEAN
✓
FOR I 1 TO 50
✓
05
✓
FOR J 1 TO 3
✓
06
✓
People[I, J] ""
✓
07
✓
08
✓
NEXT J
✓
09
✓
NEXT I
✓
Count 1

Question 10

✓
Continue TRUE

Question 11

Question 12

✓
REPEAT

Question 13

✓
OUTPUT "Enter the last name"

Question 14

✓
INPUT People[Count, 1]

Question 15

✓
OUTPUT "Enter the first name"

Question 16

✓
INPUT People[Count, 2]

Question 17

✓
OUTPUT "Enter the city"

Question 18

✓
INPUT People[Count, 3]

Question 19

✓
OUTPUT "Do you want to enter another name (Y or N)?"

Question 20

✓
INPUT Response
✓
0478/23
✓
Cambridge IGCSE – Mark Scheme
✓
May/June 2024
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 0478_s24_ms_23.pdf →

Show text version of question

Question 4

Part (a)

Question 4

This pseudocode algorithm is intended to allow data for up to 50 people to be entered and stored

in a two-dimensional (2D) array. The data is their last name, first name and the city in which they live.

01 DECLARE People : ARRAY[1:50, 1:3] OF REAL 02 DECLARE Count : INTEGER 03 DECLARE Response : CHAR 04 DECLARE Continue : BOOLEAN 05 FOR I 1 TO 50 06 FOR J 1 TO 3 07 People[I, J] "" 08 NEXT J 09 NEXT I 10 Count 100 11 Continue TRUE 12 CASE OF 13 OUTPUT "Enter the last name" 14 INPUT People[Count, 1] 15 OUTPUT "Enter the first name" 16 INPUT People[Count, 2] 17 OUTPUT "Enter the city" 18 INPUT People[Count, 3] 19 OUTPUT "Do you want to enter another name (Y or N)?" 20 INPUT Response 21 IF Response = 'N' 22 THEN 23 Continue FALSE 24 ELSE 25 Count Count + 1 26 ENDIF 27 UNTIL NOT Count

Part (a)

Identify the line numbers of the four errors in the pseudocode and suggest corrections.

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

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

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

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

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

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

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

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

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

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

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

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

[4]

Question 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 0478_s24_qp_23.pdf

Keep practising this topic