Examo
About

© 2026 Examo. Free IGCSE revision built around the mark scheme.

About
  • Home
  • Practice
  • Flashcards
  • Saved
Homecomputer-scienceProgramming Concepts
0984

Programming Concepts

Programming · 4 question types

PractiseFlashcards
Download PDF

0984 Topics

Programming Concepts13%
  1. Variables, Constants and Data Types
  2. Arithmetic Operators
  3. Comparison (Relational) Operators
  4. Logical (Boolean) Operators
  5. String Operations
  6. A Reference Card
Arrays5%
File Handling3%
Procedures and Functions4%

Frequency legend

High (≥14%)
Above avg (10 to 13%)
Average (<10%)

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.

Every program manipulates data: numbers, text, true/false values. To work with data, the program stores values in named (which can change) and (which cannot).

Variables

A variable is a named storage location whose value can change while the program is running.

In CIE pseudocode, a variable is declared with DECLARE and a data type:

DECLARE Age : INTEGER
DECLARE Price : REAL
DECLARE Name : STRING
DECLARE FirstInitial : CHAR
DECLARE GameOver : BOOLEAN

After declaration, a value is assigned with the arrow operator ←:

Age ← 17
Price ← 9.99
Name ← "Alice"
FirstInitial ← 'A'
GameOver ← FALSE

Constants

A constant is a named storage location whose value is set once and cannot change for the rest of the program.

CONSTANT PI ← 3.142
CONSTANT VAT ← 0.20
CONSTANT MAX_LIVES ← 3

Constants are usually written in UPPERCASE so they stand out from variables, and they make programs easier to maintain: if VAT changes, only one line of the program has to be edited.

Naming conventions

Identifiers (the names of variables and constants) should:

  • Use letters and digits only, no spaces.
  • Start with a letter, not a digit.
  • Be in PascalCase (each word capitalised, e.g. TotalScore) or camelCase.
  • Be descriptive: StudentScore is far better than s or x.
  • For constants, prefer ALL_CAPS with underscores.

Data types

There are five basic data types. Choosing the right one for each variable makes the program more accurate and uses memory efficiently.

Data typeUsed forPseudocode keywordExamples
IntegerWhole numbers (no fractional part)INTEGER10, -5, 0, 1000
RealNumbers with a fractional partREAL3.14, -2.5, 0.0
CharA single characterCHAR'a', 'B', '7', '£'
StringA sequence of charactersSTRING"Hello world", "ABC", ""
BooleanA logical valueBOOLEANTRUE, FALSE

Notes on the difference between and string:

  • A CHAR is exactly one character, written in single quotes ('A').
  • A STRING is zero or more characters, written in double quotes ("Apple").

Casting

Sometimes a value needs to be converted from one type to another. This is called . For example, a number typed by the user arrives as a STRING and may need to be converted to an INTEGER before arithmetic can be done on it.

Common slip: trying to add "5" to "3" as strings gives "53" (concatenation), not 8. Cast to integer first.

Picking the right data type

A short reference for matching everyday data to the most suitable CIE type:

Kind of valueBest typeQuick test
Whole-number counts (age, score, year)INTEGERNo decimal point ever needed
Measurements and money (1.75 m, £8.50)REALA fractional part is possible
Names, addresses, sentencesSTRINGMore than one character, or any text
A single flag character ('M', 'F', 'Y', 'N')CHARExactly one character
Yes/no, on/off, paid/unpaidBOOLEANTwo possible values: TRUE or FALSE

When two types look possible, prefer the smaller one. A house number is an INTEGER, not a STRING. A pH reading is a REAL, not a STRING. Storing numbers as strings means losing the ability to compare or do arithmetic on them later.

Exam tip

Choosing the right data type for a given value

What comes up: a matching question gives four descriptions (or database fields) and asks for the most appropriate data type for each — appears across multiple papers.

Watch out: the traps that decide the marks — a number you never do arithmetic on (phone number, barcode, student ID) is best stored as STRING even though it is digits; money (£8.50) and measurements (1.75 m) are REAL, not INTEGER, because they can have a fractional part.