Branching in algorithms
About this lesson

Sometimes an algorithm takes a different path depending on the situation: this is branching. First a condition is checked: “Is it raining?” If it is met (yes), one branch runs; if not (no), the other runs. Only one branch runs each time. We write: “If it is raining, then take an umbrella, else take a cap.” In a flowchart the condition is drawn as a diamond (◇) with two arrows leaving it: “yes” and “no”. Actions go in rectangles, and start and end are shown as ovals.
What the book shows
In computer science the child first learns to think through unplugged games: recognising information, ordering steps and learning safety rules.
Textbook link:
This is not the textbook’s text but a short description of the topic. Check the exact page in your own textbook.
The lesson step by step
- 1
Warm-up5 min
A fork in the road.
- 2
New topic10 min
Conditions and branches.
- 3
Practice10 min
Flowchart shapes.
- 4
Game10 min
Drawing flowcharts.
- 5
Wrap-up5 min
Morning algorithm.
Let’s understand
For the student Simple language

| Shape | Meaning |
|---|---|
| ⬭ oval | start / end |
| ▭ rectangle | action: “take an umbrella” |
| ◇ diamond | condition: “Is it raining?” → yes / no |
For the parent
How to help
- Talk through getting dressed as a branching algorithm: “If it’s cold…”.
- Draw a simple flowchart on paper.
For the teacher
Lesson goals
- Know that a branching algorithm checks a condition and runs only one branch, and build “if…, then…, else…” algorithms and flowcharts.
How to teach it
- Unplugged games, cards, role play, discussion
Differentiation
- Weaker pupils: 2–3 steps; stronger pupils build their own algorithm
Questions for the class
- How does an algorithm choose a different path?
How to check
The pupil finds the condition and branches and draws a flowchart with the right shapes.
Scientific Scientific language
Branching in games
Video games have thousands of conditions like “If the hero touches a star, then add a point.”
Incomplete branching
Sometimes there’s no “else”: “If your hands are dirty, then wash them.”
Self-study
Step by step
- What is the condition?
- What is the “yes” branch?
- What is the “no” branch?
- Are the oval, rectangle and diamond right?
Going deeper
Scientific language: for older students, parents and teachers.
Conditions can sit inside other conditions: “If it’s raining, then: if it’s windy, a raincoat, else an umbrella.”
Play and check
Which flowchart shape?
How to write it down
- Draw a flowchart for “crossing at the traffic light”.
- Write 2 algorithms using “if…, then…, else…”.
How the classwork looks in the notebook
Sample: the date and heading follow this country’s notebook rules.
Watch out: common mistakes
Where it helps in life
- Loops
- Conditions in coding
At home
Core
- Draw a branching flowchart for getting ready for school.
Extra ⭐
- Build an algorithm with two conditions.
How to do it
- Do the task with a grown-up.
- Explain in words what you noticed.
Answers for parents
For example: Start → “PE today?” → yes: pack the kit → “Raining?” → yes: take an umbrella → End.
Step-by-step homework solution — Show the solution (try it yourself first)
Think
- If a number is even, then write “even”, else write “odd”. 8 → even, 7 → odd.
How the homework looks in the notebook
Sample: the date and heading follow this country’s notebook rules.