Note AcademyNote Academy

Computer Science (AS & A Level) · May / June 2024 · Paper 23 · Question 4

9618

As printed in the paper

The question as text

A procedure TwoParts() will input a sequence of real values, one at a time. The procedure will: • process the sequence in two parts • form a first total by adding the values until the first zero • form a second total by adding the values after the first zero until the second zero • output the average of the two totals, together with a suitable message. Values input in the first part are totalled using global variable TotalA and those input in the second part are totalled using global variable TotalB.

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

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

  • 4(b)(i)[2]

  • 4(b)(ii)[3]

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