Past-paper question · 2023 May-June · Paper 23 · Q6(a)

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

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

Official answer for Question 6

Part (a)

✓
One mark per mark point, max four

Question 4

✓
Line 01 / Counter 100
✓
should be Counter 0
✓
Line 03 / While Counter > 100 DO
✓
should be While Counter < 100 DO
✓
Line 07 / Total Total + Counter
✓
should be Total Total + Number
✓
Line 09 / ENDCASE
✓
should be ENDIF
✓
Correct algorithm
✓
01 Counter 0
✓
02 Total 0
✓
03 WHILE Counter < 100 DO
✓
04
✓
INPUT Number
✓
05
✓
IF Number > 0
✓
06
✓
THEN
✓
Total Total + Number
✓
07
✓
Counter Counter + 1
✓
08
✓
09
✓
ENDIF
✓
10 ENDWHILE
✓
11 OUTPUT "The total value of your numbers is ", Total
✓
12 OUTPUT "The average value of your numbers is ", Total / 100
✓
0478/23
✓
Cambridge IGCSE – Mark Scheme
✓
May/June 2023
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 0478_s23_ms_23.pdf →

Show text version of question

Question 6

Part (a)

Question 6

An algorithm has been written in pseudocode to allow 100 positive numbers to be input. The total

and the average of the numbers are output. 01 Counter 100 02 Total 0 03 WHILE Counter > 100 DO 04 INPUT Number 05 IF Number > 0 06 THEN 07 Total Total + Counter 08 Counter Counter + 1 09 ENDCASE 10 ENDWHILE 11 OUTPUT "The total value of your numbers is ", Total 12 OUTPUT "The average value of your numbers is ", Total / 100

Question 5

Part (a)

Identify the four errors in the pseudocode and suggest corrections.

Error 1 .......................................................................................................................................

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

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

Error 2 .......................................................................................................................................

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

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

Error 3 .......................................................................................................................................

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

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

Error 4 .......................................................................................................................................

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

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

[4]
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_s23_qp_23.pdf

Keep practising this topic