Skip to main content
A-LevelComputer ScienceProgramming9618/23 · May/June 2024 · Q411 Marks

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.

  1. (a)Write pseudocode for the procedure TwoParts().[6]
  2. (b)(i)Identify a suitable data structure that could be used to store the different total values.[2]
  3. (b)(ii)Describe three benefits of using the data structure given in part (b)(i).[3]

Mark scheme

Marking points from the official mark scheme (May/June 2024). The mark or mark type is shown in brackets.

  1. [1] (a) Procedure heading and ending
  2. [1] (a) Declare all local variables
  3. [1] (a) Initialise TotalA and TotalB
  4. [1] (a) First conditional loop until zero entered, summing TotalA // Loop until both parts (sequences) have been entered
  5. [1] (a) Second conditional loop until zero entered, summing TotalB // Loop summing appropriate Totals
  6. [1] (a) Calculation of average and output with a message // Calculation of the average for the values making up the two totals and both output with a suitable message
  7. [1] (b)(i) (1D) array
  8. [1] (b)(i) of 20 reals
  9. [1] (b)(ii) (Multiple instances referenced via a single identifier so) fewer identifiers needed
  10. [1] (b)(ii) Easier to process / search / organise / access the data // Values may be accessed via a loop-controlled variable /an index //An array / data can be iterated through
  11. [1] (b)(ii) Makes the program/algorithm easier to write / design / understand / maintain / modify // Simplifies the program // Easier to debug / test

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Programming, A-Level Computer Science (syllabus 9618). Structured question, 11 marks.
Source
A-Level Computer Science, May/June 2024 Paper 2 Variant 3, question 4.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep