S0-SA3-0585
What is If (Logic Condition)?
Grade Level:
Pre-School – Class 2
All domains without exception
Definition
What is it?
An 'If' (logic condition) is like asking a question that can only be answered with 'Yes' or 'No'. If the answer is 'Yes' (true), then a certain action happens. If the answer is 'No' (false), then that action does not happen, or a different action might happen instead.
Simple Example
Quick Example
Imagine your mother tells you, 'If you finish your homework, then you can watch TV.' Here, 'you finish your homework' is the 'If' condition. If it's true, you get to watch TV. If it's false (you didn't finish), you don't.
Worked Example
Step-by-Step
Let's say a mobile game gives you extra coins if your score is more than 100.
1. The condition is: 'Is your score greater than 100?'
2. Player A scores 120. Is 120 greater than 100? Yes, it's True.
3. Action: Player A gets extra coins.
---
4. Player B scores 80. Is 80 greater than 100? No, it's False.
5. Action: Player B does not get extra coins.
Answer: Player A gets extra coins, Player B does not, because only Player A met the 'If' condition.
Why It Matters
Understanding 'If' conditions helps us make decisions and build smart systems. This logic is used by computer scientists to create apps, by engineers to design machines, and even by doctors to choose treatments. It's the basis of all decision-making in technology!
Common Mistakes
MISTAKE: Thinking 'If' always means something good will happen. | CORRECTION: 'If' just means a condition is checked. The result can be good, bad, or neutral depending on what happens next.
MISTAKE: Not understanding that the 'If' condition must be clearly true or false. | CORRECTION: The condition must be specific enough to have a definite 'Yes' or 'No' answer, like 'Is the light on?' not 'Is the light okay?'
MISTAKE: Confusing the condition with the action. | CORRECTION: The 'If' part is the question (the condition), and the 'then' part is what happens (the action). They are separate.
Practice Questions
Try It Yourself
QUESTION: Your dad says, 'If the weather is sunny, we will go to the park.' If it's raining, what happens? | ANSWER: We will not go to the park.
QUESTION: A vending machine gives you a cold drink 'If you insert Rs. 20.' If you insert Rs. 10, what happens? | ANSWER: You will not get a cold drink because the condition (inserting Rs. 20) was not met.
QUESTION: A traffic light rule is: 'If the light is green, then cars can go. If the light is red, then cars must stop.' What should a car do if the light is yellow? | ANSWER: The rule doesn't specify for yellow, so the car would need another 'If' condition for yellow light (e.g., 'If yellow, then prepare to stop'). Based on *only* the given rules, neither 'go' nor 'stop' is directly triggered by yellow.
MCQ
Quick Quiz
Which of these is an example of an 'If' condition?
Eating lunch
Is the shop open?
Running fast
Singing a song
The Correct Answer Is:
B
Option B asks a question that can be answered with 'Yes' or 'No', making it a perfect 'If' condition. The other options are actions, not conditions.
Real World Connection
In the Real World
When you use an app like Zomato or Swiggy to order food, 'If' conditions are everywhere! For example, 'If the restaurant is open, then show its menu.' Or, 'If your delivery address is within 5 km, then show estimated delivery time.' This logic helps apps work smoothly.
Key Vocabulary
Key Terms
CONDITION: A statement that can be true or false, like a question with a yes/no answer. | LOGIC: The system of principles used in reasoning. | TRUE: When a condition is met or correct. | FALSE: When a condition is not met or incorrect. | ACTION: What happens as a result of a condition being true.
What's Next
What to Learn Next
Now that you understand 'If', you can explore 'If-Else' and 'Nested If' statements. These build on the basic 'If' to allow for more complex decisions, giving you even more control over what happens when a condition isn't met.


