Programming · 4 question types
Past paper frequency (2018 to 2024)
This topic accounts for approximately 13% of your exam marks.
Paper 2 is almost entirely programming. Variable types, assignments, loops and conditionals are tested every session.
Comparison operators compare two values and return a Boolean (TRUE or FALSE). They are the building blocks of IF statements and loop conditions.
| Operator | Meaning | Example | Result |
|---|---|---|---|
= | Equal to | Age = 18 | TRUE if age is 18 |
<> | Not equal to | Score <> 0 | TRUE if score is not zero |
< | Less than | Speed < 30 | TRUE if speed under 30 |
> | Greater than | Temperature > 25 | TRUE if temperature over 25 |
<= | Less than or equal to | Mark <= 40 | TRUE if mark is 40 or below |
>= | Greater than or equal to | Age >= 18 | TRUE if age is at least 18 |
Common slip: in some real programming languages (Python, Java), the test for equality is
==, not=. In CIE pseudocode the single=is correct. Using==in a pseudocode answer often costs marks.