In simple terms
A friendly intro before the formal notes — no formulas yet.
Building with Code LEGOs
Structured programming is a method of writing computer programs using a limited set of simple building blocks. This approach makes code easier to understand, test, and modify, preventing the chaotic 'spaghetti code' of the past.
Imagine writing a recipe. An unstructured recipe would be a single, confusing paragraph, making it easy to miss a step. A structured recipe uses numbered steps (sequence), gives options like 'if you prefer it less spicy, use half a chilli' (selection), and includes repeating actions like 'stir continuously for three minutes' (iteration). This structured approach is far more reliable and easier for anyone to follow.
- 1
Decompose the Problem: Start with the main task and break it down into smaller, self-contained sub-problems. This is called top-down design.
- 2
Use Standard Blocks: Write the code for each sub-problem using only three types of control structures: Sequence, Selection, and Iteration.
- 3
Construct with Modules: Combine the solutions for the sub-problems into a complete program, often using procedures and functions for each sub-task.
- 4
Test and Refine: Test each module independently before testing the entire program. This makes finding and fixing bugs (debugging) much simpler.
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.
The Three Pillars of Structured Programming
The Structured Program Theorem states that any algorithm can be constructed using only three fundamental control structures. Mastering these is essential for writing good code.
Sequence: Instructions are executed in order, one after the other. This is the default flow of any program. INPUT Name, then PRINT 'Hello ', Name.
Selection: A decision is made, and the program follows a different path based on a condition. The main constructs are IF...THEN...ELSE...ENDIF for binary or nested choices, and CASE...OF...OTHERWISE...ENDCASE for selecting from multiple distinct options.
Iteration (Repetition): A block of code is executed repeatedly. This can be a fixed number of times (FOR...TO...NEXT), while a condition is true (WHILE...DO...ENDWHILE), or until a condition becomes true (REPEAT...UNTIL).
Top-Down Design and Stepwise Refinement
Instead of trying to solve a huge, complex problem in one go, we break it down. This process is called top-down design or stepwise refinement. We start with the main goal (e.g., 'Process a customer order') and break it into smaller sub-tasks ('Validate payment', 'Check stock', 'Arrange delivery'). Each of these sub-tasks can be broken down further until they are simple enough to be written as a single procedure or function. This structure can be visualised using a hierarchy chart, which shows the main module at the top and the sub-modules branching out below it.
Benefits of the Structured Approach
Adopting structured programming isn't just about following rules; it provides significant, practical advantages in software development. Programs become easier to read because the flow of control is logical and predictable. This directly improves maintainability; if a tax rate changes, a developer can easily find and update the single CalculateTax function instead of hunting through tangled code. Using modules (procedures/functions) promotes reusability, saving time and effort. For example, a ValidateEmail function can be used in many different parts of an application. This modularity also makes testing far more effective, as each component can be tested in isolation before being integrated into the main system, simplifying debugging.
Worked examples
See the formulas applied — reveal one step at a time, like the exam.
A teacher needs a program to find the highest and lowest scores from a class of 25 students. Use stepwise refinement to design an algorithm and represent the first level of refinement.
- 1
Initialise variables (e.g., HighestScore, LowestScore).
A program needs to calculate the total cost for a number of items. A discount of 10% is applied if the total number of items is 10 or more. Each item costs £2.50. Design a structured pseudocode algorithm that takes the number of items as input and outputs the final cost.
- 1
Correct declaration of variables.
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 Structured Programming?
A programming paradigm aimed at improving code clarity and maintainability by using only three control structures: sequence, selection, and iteration.
Key takeaways
Review these before you close the topic — retrieval beats re-reading.
- ✓
Sequence: Instructions are executed in order, one after the other. This is the default flow of any program. INPUT Name, then PRINT 'Hello ', Name.
- ✓
Selection: A decision is made, and the program follows a different path based on a condition. The main constructs are IF...THEN...ELSE...ENDIF for binary or nested choices, and CASE...OF...OTHERWISE...ENDCASE for selecting from multiple distinct options.
- ✓
Iteration (Repetition): A block of code is executed repeatedly. This can be a fixed number of times (FOR...TO...NEXT), while a condition is true (WHILE...DO...ENDWHILE), or until a condition becomes true (REPEAT...UNTIL).
Practice — then mark it
The whole point: a real Cambridge question, marked mark-by-mark.
Practice Structured Programming
Practice Structured Programming
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 Structured Programming on paper, snap a photo, and get examiner-style feedback on exactly where you win and lose marks.