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

Question 6(a) 2024 · October-November · Paper 23 · 4 marks

Question 6

Part (a)

Question 6

An incomplete algorithm has been written in pseudocode to count the number of values stored in an array and to find their average. Values have been stored in the array starting at A[1] All the values to be counted are non-zero.

A
value of zero in the array indicates there are no more values stored.

01 DECLARE A : ARRAY[1:50] OF INTEGER 02 DECLARE C : INTEGER 03 DECLARE W : INTEGER 04 DECLARE X : INTEGER 05 W 0 06 C ................................................................................................. 07 WHILE A[C] <> 0 08 W ................................................................................................. 09 C

C
+ 1

10 ENDWHILE 11 X .................................................................................................

Part (a)

Complete the given pseudocode algorithm.

[3]
Reveal official mark-scheme answer Official mark-scheme answer for 6(A)

Mark scheme 0478_w24_ms_23.pdf →

Topic relevance

Why this question appears here

98% assigned-topic match · Programming › Programming concepts

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

Keep practising this topic