Sequence, selection and iteration at A Level – OCR A Level Computer Science lesson (H446)
Students learn to identify sequence, selection and iteration in code, and choose between IF, ELSEIF and SWITCH for a task.
Lesson 2 of 16 in unit 12.2 Programming Foundations and Computational Thinking, taught in Year 12, Autumn 1. It answers one big question: Which construct does each part of a program need?
By the end, students can identify sequence, selection and iteration in code, and choose between IF, ELSEIF and SWITCH for a task.
- The Build (the main task)
- Write a program in Python and OCR pseudocode that repeatedly asks for the free spaces at a Fernbridge CycleShare docking station until −1 is entered, outputs 'Full' (0), 'Nearly full' (1 to 3) or 'Spaces' for each, and finally outputs how many stations were full (6 marks).
- Support version
- Part-filled code: the loop and the IF … ELSEIF … ELSE skeleton are given; students write the conditions and the counter.
- Challenge
- Explain why a SWITCH statement suits a menu choice but not the range 1 to 3.
- Real-world link
- Fernbridge CycleShare's station screens tell riders whether a docking station has space to return a bike.
- Key words
- Selection, Iteration and Construct, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “A chain of separate IF statements works the same as IF … ELSEIF”; “The order of statements does not matter as long as they are all there”.
- OCR H446 specification
- 2.2.1 (a).
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.
Students need computers for the main task.
Also sold in the Programming Foundations and Computational Thinking unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.
An independent resource written for OCR A Level Computer Science (H446). It is not endorsed by OCR or Cambridge University Press & Assessment. Programming project (NEA) lessons teach general skills on a made-up example project and give supervised time, within JCQ's rules on the help a centre may give.
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
More for A Level Computer Science
See allStudents learn to name the debugging tools in their IDE and write a short algorithm in both Python and OCR exam pseudocode.
Free sample lessonStudents learn to choose the correct primitive data type for each item of data and use casting to convert between types.
Students learn to write count-controlled and condition-controlled loops in Python and pseudocode, and state when WHILE and DO … UNTIL test their conditions.
Written for the specifications named. Not endorsed by or affiliated with any exam board.