Choose a Branch with a Number
Evaluate an inclusive threshold and execute exactly one branch.
Supplied materials
- Paper and pencil; an adult may read aloud. No device, account or purchase is needed.
Learn the idea
A condition can compare a number instead of a shape. The symbol ≥ means greater than or equal to. If/else executes the first branch when its condition is true and the else branch when it is false. Exactly one of these branches runs for each supplied input.
Use fictional counters and this paper rule: if tokens ≥ 4, write ready; else write wait. Test tokens = 3, 4 and 6. The equal value 4 matters: it is ready because the rule includes equality. The rule does not ask about the color or size of the tokens.
- Draw a table with tokens, tokens ≥ 4?, and output columns.
- Fill rows for 3, 4 and 6.
- Write true or false before writing each output.
- Circle the equal case 4 and explain why it takes the ready branch.
See the method in action
Rows: 3 | false | wait; 4 | true | ready; 6 | true | ready. No row prints both ready and wait.
Check your reasoning
Your answer is temporary and is not saved to an account. Download your current answer before leaving or reloading. Written work on paper or in another app stays in your own file.
See the answer and explanation
Ready
5 is greater than 4, so the condition is true and only ready is written.
Take it further
Change the condition to tokens > 4 and retest 3, 4, 6. Expected outputs: wait, wait, ready. Only the equal case changes.
Nothing here is saved to an account or sent to a teacher. The answer download includes your current choice and any checked feedback.
Check the subject sources
These LifeStarter passages, scenarios and exercises are authored for this Academy with AI assistance and review. External resources keep their publishers’ terms. A grade label suggests a starting level; it does not establish alignment with your school’s complete requirements.