top of page
Inaugurated by IN-SPACe
ISRO Registered Space Tutor

S0-SA3-0679

What is Repeating Until Done?

Grade Level:

Class 2

Computing, Robotics, AI, Algorithms

Definition
What is it?

Repeating Until Done means doing a task again and again until a certain condition is met or a goal is achieved. It's like a loop that keeps going as long as the 'done' condition is not true. Once the condition is true, the repeating stops.

Simple Example
Quick Example

Imagine you are trying to fill a bucket with water using a small mug. You will keep scooping water with the mug and pouring it into the bucket. You will repeat this action until the bucket is full. Once the bucket is full, you stop scooping.

Worked Example
Step-by-Step

Let's say you want to collect 10 mangoes from a tree, and you can only pick one at a time.

1. Start with 0 mangoes.
---
2. Check: Have I collected 10 mangoes? (No, I have 0).
---
3. Action: Pick one mango.
---
4. Now I have 1 mango.
---
5. Check: Have I collected 10 mangoes? (No, I have 1).
---
6. Repeat steps 3-5 until you have 10 mangoes.
---
7. Once you have 10 mangoes, the condition 'collected 10 mangoes' is true.
---
8. Stop picking mangoes.

Answer: You pick mangoes 10 times until you have collected 10 mangoes.

Why It Matters

This concept is fundamental to how computers work, helping them perform tasks efficiently. It's used in robotics to make robots perform repetitive actions, in AI for training models, and in algorithms to solve problems faster. Software engineers, data scientists, and robotics engineers use this every day.

Common Mistakes

MISTAKE: Not having a clear 'stop' condition, leading to endless repetition. | CORRECTION: Always define exactly when the repeating should stop.

MISTAKE: Checking the 'stop' condition at the wrong time (e.g., after the task is done, instead of before or during). | CORRECTION: The condition should be checked repeatedly to decide if the next action should be taken.

MISTAKE: Forgetting to make progress towards the 'stop' condition inside the repeating steps. | CORRECTION: Each repetition must bring you closer to meeting the stop condition.

Practice Questions
Try It Yourself

QUESTION: You want to eat 5 biscuits. You eat one biscuit at a time. How many times do you repeat the action 'eat one biscuit'? | ANSWER: 5 times

QUESTION: Your phone battery is at 10%. You want to charge it until it reaches 100%. If it charges 10% every 15 minutes, how many 15-minute intervals will it charge? | ANSWER: 9 intervals (from 10% to 100% is 90%, so 90/10 = 9)

QUESTION: A robot needs to deliver 20 parcels. It can carry 2 parcels at a time. It repeats the action 'pick up 2 parcels and deliver them'. How many times will the robot repeat this action until all parcels are delivered? | ANSWER: 10 times (20 parcels / 2 parcels per trip = 10 trips)

MCQ
Quick Quiz

Which of these is an example of 'Repeating Until Done'?

Reading a book from start to finish

Switching on a light switch once

Stirring a cup of chai until the sugar dissolves

Walking to school every morning

The Correct Answer Is:

C

Option C involves a repeated action (stirring) that continues until a specific condition is met (sugar dissolves). The other options are single actions or routines that don't necessarily stop based on a condition being met during the action itself.

Real World Connection
In the Real World

When you use an ATM to withdraw cash, the machine might ask you to 'Enter PIN again' if you enter it wrong. It repeats asking for the PIN until you enter it correctly or exceed the retry limit. Similarly, food delivery apps like Zomato or Swiggy keep checking your order status (preparing, picked up, delivered) until the 'delivered' condition is met.

Key Vocabulary
Key Terms

LOOP: A sequence of instructions that is continually repeated until a certain condition is reached. | CONDITION: A rule or state that determines whether a process should continue or stop. | ITERATION: A single execution of a set of instructions within a loop. | TERMINATION: The act of stopping a process or loop.

What's Next
What to Learn Next

Next, you can learn about 'Conditional Statements' (If-Else). This will help you understand how computers make choices and combine them with repeating actions to create even smarter programs. You're building a strong foundation for coding!

bottom of page