If This, Then That: Mastering Conditionals in Code

1 of 4

ICT · My World Quest — full scheme of work · pioneer

If This, Then That: Mastering Conditionals in Code

3 more
1/4
For grown-ups

Companion summary

Have you ever wondered how your phone knows to switch to silent mode at night? Conditionals power every smart decision a device makes, from traffic lights to recommendation algorithms. A single if-else statement inside a game can determine whether a player wins, loses, or gets a bonus life. When you feel confident, try nesting one conditional inside another and see what extra control you can create.

What Does a Bouncer Actually Do?

What Does a Bouncer Actually Do?

Imagine you are a bouncer at a theme-park ride. Your job is one decision repeated hundreds of times: 'Is this person tall enough?' If yes — they ride. If no — they don't. You don't re-read the rulebook every time; you just check one condition and act on the result. Every program you have ever used works the same way. Your phone's alarm fires only IF the time matches your setting. A game gives you a bonus ONLY IF your score passes a threshold. Without the ability to make decisions, a program can only follow a fixed script — no matter what the user does. Today you will look inside that decision-making engine. The key question to keep in mind: how does a computer choose which set of instructions to run?

💭 Think about this

Think of one decision you make every morning (e.g. 'If it is raining, I take an umbrella'). Write it as a plain-English IF sentence. How many possible outcomes does it have?