Past-paper question · 2024 October-November · Paper 21 · Q6(a)

Question 6(a) 2024 · October-November · Paper 21 · 3 marks

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 for each point (max three)

Question 3

  • 06 T 0
  • 08
✓
IF A[C] = 0
  • 14 NEXT C // NEXT

Mark scheme 0478_w24_ms_21.pdf →

Show text version of question

Question 6

Part (a)

Question 6

An incomplete algorithm has been written in pseudocode to count the number of zeros stored in

an array and total the non-zero values.

01 DECLARE A[1:50] : INTEGER 02 DECLARE C : INTEGER 03 DECLARE I : INTEGER 04 DECLARE T : INTEGER 05 I ← 0

06 ........................................................................................................ 07 FOR C ← 1 TO 50 08 IF A[C] .............................................................................. 09 THEN 10 T ← T + 1 11 ELSE 12 I ← I + A[C] 13 ENDIF

14 ........................................................................................................

Part (a)

Complete the given pseudocode algorithm.

[3]
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_w24_qp_21.pdf

Keep practising this topic