Past-paper question · 2025 May-June · Paper 21 · Q9(b)

Question 9(b) 2025 · May-June · Paper 21 · 6 marks

Original past-paper question for 9(B)
Original past-paper question for 9(B)
Reveal official mark-scheme answer Official mark-scheme answer for 9(B)

Official answer for Question 9

Part (b)

✓
One
✓
mark for
✓
using FUNCTION and ENDFUNCTION and RETURNS STRING

Question 6

✓
One
✓
mark for
✓
naming the function Odds.
✓
One
✓
mark for
✓
defining the parameter correctly.
✓
One
✓
mark for
✓
determining if odd/even using MOD/DIV/ROUND using parameter.
✓
One
✓
mark for
✓
correctly returning ‘Odd’ and ‘Even’.
✓
One
✓
mark for
✓
correct function call
✓
Example:
✓
FUNCTION Odds(X: INTEGER) RETURNS STRING
✓
IF MOD(X, 2) = 0
✓
THEN
✓
RETURN "Even"
✓
ELSE
✓
RETURN "Odd"
✓
ENDIF
✓
ENDFUNCTION
✓
B ← Odds(A)
✓
2210/21
✓
Cambridge O Level – Mark Scheme
✓
May/June 2025
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 2210_s25_ms_21.pdf →

Show text version of question

Question 9

Part (b)

Question 9

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

Part (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]

Question 10

, ,

Topic relevance

Why this question appears here

98% assigned-topic match · Programming › Programming concepts

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 2210_s25_qp_21.pdf

Keep practising this topic