Question 6(a) 2024 · October-November · Paper 21 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (a)
Question 3
- 06 T 0
- 08
- 14 NEXT C // NEXT
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.
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
