Skip to main content
A-LevelComputer ScienceProgramming9618/22 · Oct/Nov 2023 · Q49 Marks

A procedure Count() will: 1. input a value (all values will be positive integers) 2. count the number of odd values and count the number of even values 3. repeat from step 1 until the value input is 99 4. output the two count values, with a suitable message. The value 99 must not be counted.

  1. (a)Write pseudocode for the procedure Count().[6]
  2. (b)The procedure Count() is to be tested. Typical test data would consist of odd and even values, for example: 23, 5, 64, 100, 2002, 1, 8, 900, 99 The purpose of this test would be to test a typical mix of even and odd values and check the totals. Give three test data sequences that may be used to test different aspects of the procedure. Do not include invalid data. Sequence 1: Test data Purpose of test. Sequence 2: Test data Purpose of test. Sequence 3: Test data Purpose of test.[3]

Mark scheme

Marking points from the official mark scheme (Oct/Nov 2023). The mark or mark type is shown in brackets.

  1. [6] Mark as follows Max 6 marks:
  2. 1 Procedure heading and ending
  3. 2 Local COdd, CEven and ThisNum declared as integers
  4. 3 Conditional loop while ThisNum <> 99
  5. 4 Input ThisNum in a loop
  6. 5 Check ThisNum is odd or even in a loop
  7. 6 Increment appropriate count in a loop, both counts must have been initialised before loop
  8. 7 After the loop output COdd and CEven with a suitable message following a reasonable attempt at counting
  9. [3] One mark per set, including stated purpose. Max 3 marks
  10. Example answers:
  11. 1 data set with (only) odd values, terminated with 99
  12. 2 data set with (only) even values, terminated with 99
  13. 3 data sets with same number of odd and even values, terminated with 99
  14. 4 data sets with all even / all odd with just one odd/even value, terminated with 99
  15. 5 data sets with no values just final 99
  16. 6 data sets without (terminating) 99 // missing or incorrectly placed 99

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, 9 marks.
Source
A-Level Computer Science, Oct/Nov 2023 Paper 2 Variant 2, 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