Question 4(a) 2024 · May-June · Paper 23 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (a)
Question 4
Question 10
Question 11
Question 12
Question 13
Question 14
Question 15
Question 16
Question 17
Question 18
Question 19
Question 20
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 .................................................................................................................................
...................................................................................................................................................
Question 5
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
