0
0
Intro to Computingfundamentals~5 mins

Loops (repeating actions) in Intro to Computing - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a loop in programming?
A loop is a way to repeat a set of instructions multiple times until a condition is met, like doing the same chore over and over until it's done.
Click to reveal answer
beginner
Name two common types of loops.
Two common loops are:<br>1. For loop: repeats a set number of times.<br>2. While loop: repeats while a condition is true.
Click to reveal answer
intermediate
What happens if a loop's condition never becomes false?
The loop runs forever, called an infinite loop. It's like a chore that never ends and can freeze a program.
Click to reveal answer
beginner
Explain a real-life example of a loop.
Imagine washing dishes: you wash one dish, then the next, and keep going until no dishes are left. This is like a loop repeating an action until a condition (no dishes) is met.
Click to reveal answer
beginner
What is the purpose of a loop counter?
A loop counter keeps track of how many times the loop has run, helping to stop the loop after a set number of repeats.
Click to reveal answer
Which loop repeats a fixed number of times?
AFor loop
BWhile loop
CIf statement
DSwitch case
What is an infinite loop?
AA loop that never stops
BA loop that runs once
CA loop that counts to zero
DA loop that skips steps
Which part of a loop decides when to stop?
ACounter
BFunction
CVariable
DCondition
What does a loop counter do?
AChanges the loop condition
BCounts how many times the loop runs
CStops the program
DStarts the loop
Which loop type repeats while a condition is true?
ADo-while loop
BFor loop
CWhile loop
DSwitch loop
Describe how a loop works using a real-life example.
Think about doing the same task repeatedly until something changes.
You got /3 concepts.
    Explain the difference between a for loop and a while loop.
    One counts repeats, the other checks a condition each time.
    You got /3 concepts.