Past-paper question · 2024 May-June · Paper 22 · Q7(b)

Question 7(b) 2024 · May-June · Paper 22 · 5 marks

Original past-paper question for 7(B)
Original past-paper question for 7(B)
Reveal official mark-scheme answer Official mark-scheme answer for 7(B)

Official answer for Question 7

Part (b)

✓
One mark for each error identified and corrected

Question 3

✓
Line 04 < should be >
✓
Line 08 Count should be Counter
✓
Line 11 ENDWHILE should be ENDIF
✓
01
✓
Min List[1]
✓
02
✓
FOR Counter 2 TO 1000
✓
03
✓
04
✓
IF List[Counter] > Max
✓
05
✓
THEN
✓
06
✓
07
✓
ENDIF
✓
08
✓
IF List[Counter] < Min
✓
09
✓
THEN
✓
Min List[Counter]

Question 10

Question 11

✓
ENDIF

Question 12

✓
NEXT Counter

Question 13

✓
OUTPUT "Maximum value is ", Max

Question 14

✓
OUTPUT "Minimum value is ", Min
✓
Question
✓
Answer
✓
Marks

Mark scheme 0478_s24_ms_22.pdf →

Show text version of question

Question 7

Part (b)

Question 7

An algorithm has been written in pseudocode to find and display the maximum and minimum

values in an array of 1000 positive numbers. The array List[] starts at index 1

01 Max List[1] 02 Min List[1] 03 FOR Counter 2 TO 1000 04 IF List[Counter] < Max 05 THEN 06 Max List[Counter] 07 ENDIF 08 IF List[Count] ˂ Min

09 THEN 10 Min List[Counter] 11 ENDWHILE 12 NEXT Counter 13 OUTPUT "Maximum value is ", Max 14 OUTPUT "Minimum value is ", Min

Part (b)

Identify the line numbers of the three 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 .................................................................................................................................

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

[3]

Question 7

, ,

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_22.pdf

Keep practising this topic