Skip to main content
A-LevelComputer ScienceProgramming9618/21 · May/June 2024 · Q46 Marks

A global 1D array Data contains 100 elements of type integer. A function Check() will: • total the element values in odd index locations (1, 3, 5 ... 97, 99) • total the element values in even index locations (2, 4, 6 ... 98, 100) • return one of three strings 'Odd', 'Even' or 'Same' to indicate which total is the greater, or whether the totals are the same. Write pseudocode for the function Check().

  1. A global 1D array Data contains 100 elements of type integer. A function Check() will: • total the element values in odd index locations (1, 3, 5 ... 97, 99) • total the element values in even index locations (2, 4, 6 ... 98, 100) • return one of three strings 'Odd', 'Even' or 'Same' to indicate which total is the greater, or whether the totals are the same. Write pseudocode for the function Check().[6]

Mark scheme

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

  1. [6] Example:
  2. FUNCTION Check() RETURNS STRING
  3. DECLARE Odd, Even, Index : INTEGER
  4. Odd ← 0
  5. Even ← 0
  6. FOR Index ← 1 TO 100
  7. IF Index MOD 2 = 0 THEN
  8. Even ← Even + Data[Index]
  9. ELSE
  10. Odd ← Odd + Data[Index]
  11. ENDIF
  12. NEXT Index
  13. ENDFUNCTION
  14. Mark as follows:
  15. 1. Function heading, ending and return type
  16. 2. Declare local variables Odd, Even and Index as integers
  17. 3. Initialise Odd and Even
  18. 4. Loop for 100 iterations // through array
  19. 5. Sum Odd and Even element values in a loop
  20. 6. Compare Odd and Even after the loop and Return appropriate string

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, 6 marks.
Source
A-Level Computer Science, May/June 2024 Paper 2 Variant 1, 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