Skip to main content
O-LevelComputer ScienceProgramming2210/21 · May/June 2025 · Q98 Marks

The variables A and B are used in a program. A holds a whole number and B holds text.

  1. (a)Write pseudocode statements to declare the variables A and B[2]
  2. (b)The function Odds (X) returns 'Odd' if the value of x is an odd number and returns 'Even' if the value of x is an even number. Write pseudocode statements to: • define the function • call the function using parameter A and store the return item in variable B Function definition Function call[6]

Mark scheme

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

  1. [1] (a) DECLARE A: INTEGER
  2. [1] (a) DECLARE B: STRING
  3. [1] (b) One mark for using FUNCTION and ENDFUNCTION and RETURNS STRING
  4. [1] (b) One mark for naming the function Odds.
  5. [1] (b) One mark for defining the parameter correctly.
  6. [1] (b) One mark for determining if odd/even using MOD/DIV/ROUND using parameter.
  7. [1] (b) One mark for correctly returning 'Odd' and 'Even'.
  8. [1] (b) One mark for correct function call
  9. Example (b): FUNCTION Odds(X: INTEGER) RETURNS STRING IF MOD(X, 2) = 0 THEN RETURN "Even" ELSE RETURN "Odd" ENDIF ENDFUNCTION B ← Odds (A)

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, O-Level Computer Science (syllabus 2210). Structured question, 8 marks.
Source
O-Level Computer Science, May/June 2025 Paper 2 Variant 1, question 9.

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