Programming practice: selection – AQA GCSE Computer Science lesson (8525)
Pupils learn to build and test a selection program in the class's language with normal and boundary values.
Lesson 10 of 12 in unit 10.2 Memory, Storage and Selection, taught in Year 10, Autumn 2. It answers one big question: How do we build and test a program that makes decisions?
By the end, pupils can build and test a selection program in the class's language with normal and boundary values.
- The Build (the main task)
- Write a program for the leisure centre's ticket kiosk. It must: input the visitor's age, whether they are a member (yes or no) and the activity (swim or gym); work out the price – swims are £5 for 16 and over, £3 for 5 to 15 and £0 under 5, and the gym is £6; take £1 off for members if the price is more than £0; output the price. Then test it with boundary test data. (7 marks)
- Support version
- Parsons problem with one distractor that uses > where ≥ is needed.
- Challenge
- Complete a test plan for the swim age rule: give one normal test and two boundary tests, with the expected price for a non-member. (3 marks) Extend the program: a family ticket (activity family) is £12 for the whole family, and members still get £1 off. (4 marks) Extend the program so it also inputs the hour (0 to 23). Swims before 9 o'clock cost £1 less, but a price never goes below £0. (6 marks)
- Real-world link
- The finished kiosk ticket program, tested before the leisure centre uses it.
- Key words
- Selection, Nested selection and Test data, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “If the program works for one input, it works for all”; “Writing OUTPUT in a program is fine”.
- AQA 8525 specification
- 3.2.2 (programming concepts: selection and nested selection); 3.2.4 (relational operations); 3.2.5 (boolean operations: NOT, AND, OR).
Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.
Pupils need computers for the main task.
Also sold in the Memory, Storage and Selection unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.
Choose your school's Paper 1 language when you buy: C#, Python or VB.NET. You get that language's files: every program, code example, worked answer and programming task is written in it, and lessons with no code are the same in all three. Algorithms are also shown in AQA pseudo-code, as in the exam.
An independent resource written for AQA GCSE Computer Science (8525). It is not endorsed by AQA.
What's included
- Slide deck (PowerPoint)
- Lesson plan (Word)
- Worksheet (Word)
- Support worksheet with scaffolds (Word)
- Single-teacher licence: use and adapt it with your own classes
- Your choice of Paper 1 language: C#, Python or VB.NET
More for GCSE Computer Science (AQA)
See allPupils learn to explain what main memory is, why the CPU needs it and why it is volatile.
Pupils learn to write selection with IF, ELSE and ELSE IF in the class's language and read it in AQA pseudo-code.
Pupils learn to describe what RAM, ROM, cache and registers are each used for and why each is needed.
Written for the specifications named. Not endorsed by or affiliated with any exam board.