Grade 8 · Media & Informatics
Use loops (repeat) and conditions (if/else) to describe simple programs.
Programs do not only run top to bottom — they can repeat and they can choose. A loop tells the computer to repeat a set of steps. Instead of writing 'take a step' fifty times, you write 'repeat 50 times: take a step'. Loops save effort and avoid mistakes.
A condition lets a program choose what to do, using if/else. For example: 'if it is raining, take an umbrella; else wear a cap.' The computer checks whether the condition is true, then runs the matching branch. This is how programs react to different situations.
Loops and conditions often work together. 'Repeat until the answer is correct' combines a loop with a check. With just these two ideas — repeat and choose — you can already describe a surprising amount of what programs do.
Have a go right here. Nothing is saved and you can retry as much as you like. Create a free account when you want to save your progress and get Archie, your tutor.
Create a free account to save your progress, track mastery and ask Archie, your tutor, for a hand.
Already with us? Open this lesson in learncoach.ch for mastery tracking and Archie, your tutor.