In simple terms
A friendly intro before the formal notes — no formulas yet.
The Algorithm's Recipe Book
Programming constructs are the fundamental instructions that tell a computer what to do and in what order. They are the basic building blocks for creating any algorithm, just like a recipe is built from simple steps.
Imagine you're following a recipe. Sequence is following the steps in order (e.g., chop vegetables, then heat the pan). Selection is making a choice based on a condition (e.g., if the sauce is too thick, then add water, else continue simmering). Iteration is repeating an action (e.g., repeat stirring until the sauce is smooth). All complex recipes, and all complex programs, are just combinations of these three ideas.
- 1
Sequence: Code runs line by line, in the order it's written, like following a simple list of instructions.
- 2
Selection (IF/CASE): The program makes a decision. It checks a condition and chooses which block of code to run next.
- 3
Iteration (Loops): A block of code is repeated. This can be a set number of times (FOR), while a condition is true (WHILE), or until a condition becomes true (REPEAT).
- 4
Nesting: Constructs can be placed inside one another. For example, a loop (FOR) might contain a decision (IF) to handle different cases on each repetition.
Explore the concept
Use the live diagram and synced steps — play it or tap a step card to walk through.
Full topic notes
Formal explanation with the rigour you need for the exam.
1. Sequence
Sequence is the most basic construct. It dictates that instructions are executed one after another, in the same order that they appear in the program. Unless you use a selection or iteration statement to change the flow, a program will always follow a sequential path.
INPUT Name OUTPUT "Hello, ", Name Total <- Price * Quantity
2. Selection
Selection constructs allow a program to make decisions. Based on a Boolean condition (something that evaluates to TRUE or FALSE), the program chooses between two or more different paths of execution. The main selection constructs are IF...THEN...ELSE and CASE...OF...OTHERWISE.
IF...THEN...ELSE...ENDIF: Used for single or binary choices. The ELSE part is optional. You can chain them using ELSEIF for multiple conditions.
CASE...OF...OTHERWISE...ENDCASE: Ideal for selecting one path from many, based on the value of a single variable or expression. It's often cleaner than multiple ELSEIFs.
Nested Selection: An IF or CASE statement can be placed inside another one to handle more complex, multi-level conditions.
Conditions use relational operators (, , , , , ) and logical operators (AND, OR, NOT).
3. Iteration (Repetition)
Iteration allows a block of code to be executed multiple times. This is essential for processing collections of data, validation, and many other common programming tasks. There are three types of loops, each suited to different scenarios.
Count-Controlled Loop (FOR...TO...NEXT): Use when you know exactly how many times you need to repeat. A counter variable is automatically incremented (or decremented using STEP -1).
Pre-Condition Loop (WHILE...DO...ENDWHILE): Use when the number of repetitions is unknown. The loop continues while a condition is TRUE. The condition is checked at the start, so the loop may not run at all.
Post-Condition Loop (REPEAT...UNTIL): Also used when the number of repetitions is unknown. The loop repeats until a condition becomes TRUE. The condition is checked at the end, so the loop always executes at least once. This is very useful for input validation.
Always ensure your constructs are properly closed: IF needs ENDIF, WHILE needs ENDWHILE, CASE needs ENDCASE, and FOR needs NEXT. Forgetting these is a common way to lose marks. Also, use indentation in your exam answers. While not always required for marks, it makes your code vastly more readable for the examiner and helps you spot errors in your own logic, especially with nested constructs.
Worked examples
See the formulas applied — reveal one step at a time, like the exam.
A cinema charges for tickets based on age. Ages 12 and under pay £6. Ages 13 to 17 pay £8. Ages 18 to 64 pay £12. Seniors (65+) pay £7. Write a pseudocode algorithm that takes an age as input and outputs the correct ticket price.
- 1
Correctly declaring variables (Age, Price).
Write a pseudocode algorithm that calculates the average of a set of positive scores entered by a user. The user will enter -1 to signify they have finished entering scores. The program should not include the -1 in the calculation.
- 1
Initialisation of Total and Count to 0.
How it all connects
The big idea sits in the middle — tap a linked idea to explore the link.
Tap a linked idea to see how it connects back to the main topic — that connection is what examiners reward.
Glossary
Try to recall each definition before you reveal it.
Quick check
Answer in your head first — then tap to check. No pressure.
Revision flashcards
Flip the card. Test yourself before the exam.
What is Sequence in programming?
The execution of statements one after another in the order they are written in the source code. It is the default control structure.
Key takeaways
Review these before you close the topic — retrieval beats re-reading.
- ✓
IF...THEN...ELSE...ENDIF: Used for single or binary choices. The ELSE part is optional. You can chain them using ELSEIF for multiple conditions.
- ✓
CASE...OF...OTHERWISE...ENDCASE: Ideal for selecting one path from many, based on the value of a single variable or expression. It's often cleaner than multiple ELSEIFs.
- ✓
Nested Selection: An IF or CASE statement can be placed inside another one to handle more complex, multi-level conditions.
- ✓
Conditions use relational operators (, , , , , ) and logical operators (AND, OR, NOT).
Practice — then mark it
The whole point: a real Cambridge question, marked mark-by-mark.
Practice Pseudocode Constructs
Practice Pseudocode Constructs
Extra simulations & links
PhET, GeoGebra and other curated tools — open in a new tab.
Frequently asked
Checkpoint
One marked question is worth ten re-reads — close the loop before you move on.
Reading it isn’t knowing it — prove it.
Before you move on: do Practice Pseudocode Constructs on paper, snap a photo, and get examiner-style feedback on exactly where you win and lose marks.