Note AcademyNote Academy

Computer Science (AS & A Level) · Oct / Nov 2022 · Paper 21 · Question 5

9618

As printed in the paper

The question as text

A program uses two 1D arrays of type integer. Array1 contains 600 elements and Array2 contains 200 elements. Array1 contains sample values read from a sensor. The sensor always takes three consecutive samples and all of these values are stored in Array1. A procedure Summarise() will calculate the average of three consecutive values from Array1 and write the result to Array2. This will be repeated for all values in Array1. The diagram below illustrates the process for the first six entries in Array1. Array1 Array2 Comment 10 } 15 average of first three values 20 41 average of next three values 15 40 } 41 42 Write pseudocode for the procedure Summarise(). [5]

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

Show the answer and mark scheme

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