True or False? — Simple Decisions
PrimarySome questions only have two possible answers: yes or no. In computing we call these true and false. A computer can check a true/false question and then choose what to do next based on the answer — this is called making a decision.
We often say it like this: "IF it is raining, THEN take an umbrella. OTHERWISE, wear sunglasses." The IF checks something true or false; THEN and OTHERWISE are the two different paths you can take.
Decisions let a program behave differently depending on what is happening, instead of always doing the exact same thing. A traffic light "decides": if the light is red, cars stop; if it's green, cars go. Without decisions, every program — and every traffic light — would have to do the same thing forever, no matter what was actually true.
Big idea. A decision is just a fork in the road: check something true-or-false, then follow one path or the other.
Activity: The Sorting Game. Gather a pile of toys, fruit, or drawn pictures. Ask one true/false question at a time and sort into two piles: "IS IT RED?" — everything red goes left, everything else goes right. Then take the "red" pile and ask a second question: "IS IT ROUND?" You have just built a chain of decisions — exactly what programs do when they check more than one thing.
Q1 What does "true or false" mean?
It means a statement can only be one of two things: correct (true) or not correct (false). "This apple is red" is true or false depending on the actual apple.
Q2 What is an IF used for?
An IF checks whether something is true, and only does the step that follows it when the answer is yes. It lets a set of instructions react differently depending on what is actually happening.
Q3 Can a decision check more than one thing?
Yes! You can chain decisions together, like the sorting game: first ask "is it red?", and only for the red pile, ask "is it round?" Each question narrows things down further.
How the ideas connect
Every key idea in this chapter, branching from the core concept — use it to see the whole picture at a glance.
The key facts, visualised
Worked problems, step by step
Follow each solution line by line, then try to reproduce it on paper before moving on.
Example 1IF it is raining THEN take an umbrella OTHERWISE wear a hat. It is raining. What happens?
- The condition "raining" is true.
- So take the THEN path.
Example 2Sort a number: IF number > 10 say "big" OTHERWISE say "small". Number is 4.
- Check 4 > 10, which is false.
- Take the OTHERWISE path.
Now you try
Work each one out first, then tap to reveal the worked answer.