0984

Programming Concepts

Programming · 4 question types

Exam Frequency Analysis

Past paper frequency (2018 to 2024)

This topic accounts for approximately 13% of your exam marks.

stable
High
Stable13%

Paper 2 is almost entirely programming. Variable types, assignments, loops and conditionals are tested every session.

A short reminder of every operator and function on one page.

Pseudocode keywords for variables and constants

DECLARE <identifier> : <data type>
CONSTANT <identifier> ← <value>

Data types

INTEGERREALCHARSTRINGBOOLEAN

Arithmetic

+-*/DIV(a, b)MOD(a, b)

Comparison

=<><><=>=

Logical (Boolean)

ANDORNOT

String functions

LENGTH(s)SUBSTRING(s, start, length)UCASE(s)LCASE(s)

Common pseudocode pitfalls

  • Single = for equality in CIE pseudocode (not ==).
  • Single quotes for CHAR, double quotes for STRING.
  • is the only operator; = means equality (comparison), so never use it to assign a value.
  • are 1-indexed in CIE pseudocode (not 0-indexed like Python).
  • Always declare a before using it, with the right data type.
  • Use MOD(a, b) for "is divisible by" rather than dividing and checking the fractional part.