Selection and Iteration
Ages 16–18Difficulty adapts to you
Selection and Iteration
Selection chooses between paths with if/else. Iteration repeats a block while a condition holds or for each item. Trace the first, middle, and final iterations, and identify what must remain true after each loop.
Your goals
- ✓You can use conditions, loops, counters, accumulators, and invariants to control repeated work.
- ✓You can use Selection and Iteration, model correctly.
- ✓You can use the definitions, units, assumptions, and examples to check your answer.
Words to know
- Selection and Iteration:
- Use conditions, loops, counters, accumulators, and invariants to control repeated work.
- model:
- A rule or representation used to describe a situation and make a prediction.
Examples
- 1A loop adding numbers from 1 to n uses an accumulator and a counter that increases until the stopping condition.
- 2A grading algorithm chooses a band using ordered inequalities so boundary values are not placed twice.
Why this matters
Off-by-one errors often come from unclear decisions about whether an endpoint is included.
Ask yourself: where could this idea help you make a decision, explain a pattern, or check whether an answer makes sense?
Check these
- • Do not skip the meaning of a term or give a result without explaining what it means.
- • Keep every number, symbol, label, and unit in its correct place.
- • Show enough working to check how you reached your answer.
Helpful habits
- • Read the whole question before choosing what to do.
- • Show one clear step at a time and check each step.
- • If you are stuck, draw a model, try smaller numbers, or revisit the example.
Now try your own
Create your own selection and iteration example, solve it, and explain how you checked it.
Shield
Safety & Digital Confidence“Stay safe online — never share personal information.”