Selection and Conditions — Year 5 — Year 5 Lesson Plan
National Curriculum: Computing KS2 — design, write and debug programs that accomplish specific goals, decomposing problems into smaller parts; use sequence, selection, and repetition in programs; use logical reasoning to detect and correct errors in algorithms and programs.
Overview
Building on Year 4 experience with simple if/else, pupils explore nested selection and compound conditions using AND, OR, and NOT operators. They design complex decision-making algorithms on paper before implementing them in Scratch, using scenarios where a program must evaluate multiple conditions simultaneously. The unit develops precision in logical thinking and prepares pupils for the complexity of real-world software behaviour.
Learning Objectives
- Explain what a compound condition is and use AND, OR, and NOT to create them.
- Design a nested if/else algorithm on paper before implementing it in Scratch.
- Build a Scratch program that uses nested selection to produce three or more different outcomes.
- Trace through a program containing nested conditions to predict the output for a given input.
Key Vocabulary
Suggested Lesson Structure
True or false sorting activity with compound conditions: 'It is Monday AND it is raining — if today is Tuesday and it is sunny, is this true or false?' Work through four examples covering AND, OR, and NOT. Pupils hold up true/false cards and discuss. Establish that computers make these exact kinds of evaluations millions of times per second.
Display a real-world decision tree for context: a theme park ride that pupils can board only if they are over 1.2 m tall AND under 12 years old. Model translating this into an if/else in Scratch using operator blocks. Then extend: what if there is also a junior version for pupils under 1.0 m? Show how a second if/else is nested inside the else branch to create three outcomes. Work through the algorithm in pseudocode first, then code it in Scratch step by step.
Pupils are given a printed pseudocode algorithm for a weather-advice program: if temperature > 25 AND raining = false, output 'Go to the beach'; else if temperature > 15, output 'Take a jacket'; else output 'Stay inside'. Pupils work in pairs to translate this into a Scratch program using ask/answer blocks for input and say blocks for output. They test three different input combinations and record whether the program produces the expected output.
Pupils design their own nested selection program on a planning sheet (pseudocode and a flowchart with at least three outcomes). A suggested context: a school lunch menu recommender that asks two questions and uses nested if/else to suggest a meal. Pupils who complete the plan begin coding.
Teacher displays a program with a deliberate logic error: AND used where OR was intended, resulting in a condition that can never be true (e.g. score > 10 AND score < 5). Ask: can a score ever be greater than 10 AND less than 5 at the same time? What should the operator be? Emphasise: understanding AND/OR is essential because the wrong operator can create a bug that is very hard to spot.
Common Misconceptions
- Pupils frequently confuse AND with OR in natural language: 'I want a burger and chips' is an AND in everyday speech, but in programming it means both must be true simultaneously — use Venn diagrams to illustrate the difference.
- When nesting if/else blocks, pupils sometimes place the second if/else inside the if branch rather than the else branch, producing a different logical structure — trace through the algorithm carefully to find where the nesting should occur.
Prior Knowledge
Pupils should already be able to:
- Experience using simple if/else selection blocks in Scratch from Year 4.
- Ability to use Boolean operators in the context of simple conditions.
Want a personalised version of this lesson?
Use Staffroom to generate a complete lesson plan tailored to your class — add context about ability, recent learning, or specific pupils and get a plan ready to teach. Free trial, no card required.