Question 6 2024 · October-November · Paper 23 · 10 marks
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Show text version of question
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.
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.
Part (b)
Write pseudocode to display, with suitable messages:
- the number of values stored in the array
- the average of those values stored.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Question 5
, ,
Part (c)
Meaningful identifiers have not been used in this algorithm.
Suggest suitable meaningful identifiers for:
The array
The variables
X ................................................................................................................................................
W ................................................................................................................................................
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
