This is the longest topic in the specification and the one that carries most of the Paper 1 marks. It covers the statements every program is built from, the operators that do the work, the structures that hold data, and the discipline that makes code safe to rely on. Two of the specification's supported languages are Python and C#, so the examples here use Python-style syntax with the AQA pseudo-code where the specification demands it. Learn this as something you write, not something you memorise.
What you need to know
The statement types
Use, understand and know how the following statement types can be combined in programs: variable declaration, constant declaration, assignment, iteration, selection and subroutine. Every program you will ever read or write is built from those six. The three combining principles — sequence, iteration (repetition) and selection (choice) — are basic to all high-level imperative programming languages.
Key fact: Six statement types, combined by three principles: sequence, iteration and selection.
Variables and constants
Students should know why named constants and variables are used. A variable holds a value that can change; a constant holds a value that is fixed for the whole program. Naming them matters because a named constant documents the meaning of a number — if the value of pi or of a price per unit is stored in a named constant, you can change it in one place and read the code afterwards without having to work out what 3.14159 meant.
Key fact: Named constants document the meaning of a value and make it changeable in one place.
Definite iteration
Use definite (count controlled) iteration, where you know in advance how many times the loop will run. The AQA example is FOR i ← 1 TO 5 … ENDFOR. The loop variable is set to 1, the body runs, the loop variable is incremented, and the body repeats until the variable passes 5 — so the body runs exactly five times.
Key fact: Definite iteration runs a known number of times: FOR i ← 1 TO 5 … ENDFOR.
Indefinite iteration
Indefinite (condition controlled) iteration repeats until a condition becomes false, so you cannot say in advance how many times it will run. A theoretical understanding of conditions at either end of the iterative structure is required, regardless of whether your language supports them. The condition at the start is the WHILE loop; the condition at the end is the REPEAT…UNTIL and DO…WHILE structure.
Key fact: Indefinite iteration repeats until a condition changes: condition at the start is WHILE, at the end is REPEAT…UNTIL or DO…WHILE.
Nested structures
Use nested selection and nested iteration structures. A nested loop is a loop inside a loop, and it runs the inner loop once for every pass of the outer one — so a FOR loop of 5 inside a WHILE loop of 3 iterations runs the inner body 15 times. A nested IF is an IF inside an IF, and it is how you express 'if A and also if B'.
Key fact: A nested loop runs its inner body once for every pass of the outer loop.
Identifier names
Use meaningful identifier names and know why it is important to use them. Identifier names include names for variables, constants and subroutine names. A name like x tells the reader nothing; a name like totalPrice tells them exactly what is being held, which matters for the code itself and for the person marking it and maintaining it later.
Key fact: Use meaningful identifier names — they document the code for whoever reads it next.
Flashcards
Name the six statement types.
Variable declaration, constant declaration, assignment, iteration, selection and subroutine (procedure/function).
What are the three combining principles?
Sequence, iteration (repetition) and selection (choice).
What is the difference between definite and indefinite iteration?
Definite iteration runs a known, count-controlled number of times; indefinite iteration repeats until a condition changes and the number of passes is not known in advance.
Which loop structure tests its condition at the end?
REPEAT…UNTIL and DO…WHILE. A WHILE loop tests its condition at the start.
How many times does the body of a FOR i ← 1 TO 5 loop run?
Five times.
What is a nested loop?
A loop inside another loop, so the inner body runs once for every pass of the outer loop.
Why use meaningful identifier names?
They document what the value holds, which helps the code, the marker and anyone maintaining it later.
Exam questions
Written in the style of AQA Computer Science, with a mark scheme for each one. No question here is a real past paper question.
mcq1 mark
Which statement type is used to make a decision in a program?
Iteration
Assignment
Variable declaration
Selection
Mark scheme: 1 mark for identifying selection. Iteration repeats a block of instructions, assignment stores a value and a variable declaration creates a variable.
short3 marks
Explain in English the difference between definite and indefinite iteration, and give an example structure for each.
Mark scheme: 1 mark for stating that definite iteration runs a known count-controlled number of times, for example FOR i ← 1 TO 5 … ENDFOR. 1 mark for stating that indefinite iteration repeats until a condition becomes false, for example WHILE NotSolved … ENDWHILE or REPEAT … UNTIL Solved. 1 mark for explaining that the condition in an indefinite loop may be tested at the start or at the end and that both must be understood.
six6 marks
Explain in English how the statement types and the three combining principles are used together to build a program.
Mark scheme: Level 1 (1-2 marks): A short answer naming the three combining principles. Level 2 (3-4 marks): A structured answer covering the statement types and the loop structures. Level 3 (5-6 marks): A detailed answer explaining that sequence, iteration and selection are the only ways of combining statements and that they apply in every high-level imperative language, describing definite and indefinite iteration with examples and the difference between a condition at the start and at the end, explaining how nesting works and how many times a nested loop body runs, and explaining why named constants, meaningful identifiers and clear structure matter for correctness and for the person who has to maintain the code.