Computer explorers · 14/50 · Ages 8–10
If it rains…
Free · No ads · No behavioral tracking. No account needed; progress stays in this browser. Privacy for families
Fox’s pretend weather program checks a condition. If it rains, choose an umbrella; otherwise choose a sun hat. A condition helps a program choose a branch.
What you will discover
- An if instruction checks whether a condition is true.
- The else branch is used when that condition is false.
English vocabulary
- if
- nếu
- condition
- điều kiện
Let’s play
In this pretend program, rain is true. Which branch runs?
- The umbrella branch
- The sun-hat branch
- Both branches automatically
See the explanation
The true condition selects the if branch.
Practise touch typing
Place your hands on F and J and type this sentence using ten fingers.
If it rains, I choose an umbrella.
Two little quiz questions
1. When does this else branch run?
- When the rain condition is false
- Only after both branches
- Always
Answer and explanation
When the rain condition is false. Else provides the alternative for a false condition.
2. Which statement is a condition?
- Is the path clear?
- Take three steps
- Draw a fox
Answer and explanation
Is the path clear?. A condition can be checked as true or false.