S0-SA3-0551
What is an If-Then Statement?
Grade Level:
Pre-School – Class 2
All domains without exception
Definition
What is it?
An If-Then statement is a rule that tells us to do something only IF a certain condition is true. It helps us make decisions based on whether something happens or not. It's like saying, 'IF this happens, THEN do that.'
Simple Example
Quick Example
Imagine you are playing cricket. IF the bowler bowls a no-ball, THEN your team gets an extra run. Here, 'bowler bowls a no-ball' is the condition, and 'your team gets an extra run' is what happens if the condition is true.
Worked Example
Step-by-Step
Let's say you want to buy a new cricket bat. The shop has a rule:
1. **Condition:** IF your marks in Maths are 90 or more.
2. **Action:** THEN you get a 10% discount on the bat.
---
3. **Scenario 1:** Your Maths marks are 95.
4. **Check Condition:** Is 95 (your marks) 90 or more? Yes, it is true.
5. **Apply Action:** You get a 10% discount.
---
6. **Scenario 2:** Your Maths marks are 85.
7. **Check Condition:** Is 85 (your marks) 90 or more? No, it is false.
8. **Result:** You do not get a 10% discount.
Answer: You get a discount only if your Maths marks are 90 or above.
Why It Matters
If-Then statements are fundamental building blocks for all kinds of logical thinking and problem-solving. They are crucial in computer programming, where they control how apps work, and in robotics, guiding machines to make decisions. Learning this helps you think like a coder or an engineer, preparing you for careers in AI, software development, and data science.
Common Mistakes
MISTAKE: Thinking the 'THEN' part always happens, even if the 'IF' condition is false. | CORRECTION: The 'THEN' action only happens IF and ONLY IF the 'IF' condition is completely true. If the condition is false, the 'THEN' action is skipped.
MISTAKE: Confusing the condition with the action. | CORRECTION: The 'IF' part describes something that might happen or be true (the condition). The 'THEN' part describes what you DO or what happens as a result (the action).
MISTAKE: Not understanding what happens if there's no 'ELSE' part. | CORRECTION: If an If-Then statement doesn't have an 'ELSE' part, and the 'IF' condition is false, then simply nothing happens. The action is just ignored.
Practice Questions
Try It Yourself
QUESTION: IF you finish your homework by 6 PM, THEN you can watch your favorite cartoon. If you finish at 6:30 PM, can you watch the cartoon? | ANSWER: No, because the condition (finishing by 6 PM) is not met.
QUESTION: A mobile data plan says: IF you recharge with ₹299, THEN you get 1GB extra data. If you recharge with ₹199, how much extra data do you get? | ANSWER: You get 0GB extra data, because the condition (recharging with ₹299) was not met.
QUESTION: Your school library has a rule: IF you return a book late, THEN you pay a fine of ₹5 per day. You returned a book 3 days late. How much fine do you pay? | ANSWER: The condition (returning a book late) is met. So, you pay ₹5 (per day) * 3 (days) = ₹15 fine.
MCQ
Quick Quiz
Which of these is an example of an If-Then statement?
My friend likes mangoes.
IF it rains, THEN I will take an umbrella.
The bus arrived late.
I have two pencils and three pens.
The Correct Answer Is:
B
Option B clearly shows a condition ('IF it rains') and an action that follows ('THEN I will take an umbrella'). The other options are simple statements of fact or preference, not conditional rules.
Real World Connection
In the Real World
If-Then statements are everywhere! When you use a traffic light, IF the light is red, THEN you stop. When you order food on Swiggy or Zomato, IF your address is outside the delivery area, THEN the app tells you it cannot deliver. Even the automatic gates at railway stations use If-Then logic: IF you scan a valid ticket, THEN the gate opens.
Key Vocabulary
Key Terms
CONDITION: Something that must be true for an action to happen. | ACTION: What happens if the condition is true. | LOGIC: The process of reasoning and making decisions. | DECISION-MAKING: Choosing between different options based on rules.
What's Next
What to Learn Next
Now that you understand If-Then statements, you're ready to explore 'If-Then-Else' statements. This builds on what you've learned by giving you a specific action to take even when the 'If' condition is not true, making your decision-making even smarter!


