Note AcademyNote Academy

Computer Science · Oct / Nov 2023 · Paper 22 · Question 6

0478

As printed in the paper

The question as text

The flowchart represents an algorithm that performs a process on groups of values that are input. The algorithm will fail if the first value of any group is 0. An input of –1 will terminate the algorithm. START STOP Total 0 Count 0 INPUT Value IS Value = 0 ? IS Value = –1 ? No No Yes Yes Total Total + Value Count Count + 1 Average Total / Count OUTPUT "Total is ", Total OUTPUT "Average is ", Average

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

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

    One mark per correct column, max five

    Value

    Average

    Total

    Count

    OUTPUT 0

    0

    25

    25

    1

    35

    60

    2

    3

    63

    3

    0

    21

    Total is 63 Average is 21 0

    0

    57

    57

    1

    20

    77

    2

    25

    102

    3

    18

    120

    4

    0

    30

    Total is 120 Average is 30 0

    0

    −1

  • 6(b)[2]

    One mark per mark point, max two

    MP1

    to add together / find the average of a batch of numbers

    MP2

    the total and average are output (when the batch is complete/when 0 is entered)

    MP3

    when 0 is entered a new batch is started.

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