Note AcademyNote Academy

Computer Science · Oct / Nov 2024 · Paper 23 · Question 6

2210

As printed in the paper

The question as text

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

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 6(a)[3]

  • 6(b)[3]

  • 6(c)[3]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.