Computer Science
Grade 1
20 min
If the Light is Green, Then...
Understanding the consequence of a green traffic light (crossing the street).
Tutorial Preview
1
Introduction & Learning Objectives
Learning Objectives
Identify the 'if' part (condition) in a simple rule.
Identify the 'then' part (action) in a simple rule.
Create their own 'If...Then...' rule using pictures or words.
Explain that the 'then' action only happens if the 'if' part is true.
Follow a simple two-step algorithm that includes a conditional statement.
Give an example of an 'If...Then...' rule from their daily life.
Have you ever waited for a traffic light? π¦ What do you do if the light is green?
Today, we will learn about special rules called 'If...Then...' rules. These rules help computers, and us, make smart choices! It's like a game of 'Simon Says'.
Real-World Applications
Crossing the street safely πΆββοΈ...
2
Key Concepts & Vocabulary
TermDefinitionExample
If...Then...A special rule that tells us what to do.IF it is raining, THEN I will wear my boots. π§οΈπ’
Condition (The 'If' part)The question or check we do first.The condition is: 'Is the light green?' π€
Action (The 'Then' part)The thing we do if the condition is true.The action is: 'Go!' ππ¨
RuleA direction that tells you how to do something.A rule is: 'Wash your hands before you eat.' π§Ό
DecisionMaking a choice about what to do next.You make a decision to go when the light turns green. β
TrueWhen the condition is a 'yes'.The light IS green. That is true! π
3
Core Syntax & Patterns
The Basic 'If...Then...' Pattern
If [something is true], then [do an action].
Use this to make a choice. First, check the 'If' part. If it's a 'yes', then you do the action.
The 'Do Nothing' Pattern
If [something is NOT true], then [do nothing].
If the 'If' part is a 'no', you just wait. You don't do the action.
4 more steps in this tutorial
Sign up free to access the complete tutorial with worked examples and practice.
Sign Up Free to ContinueSample Practice Questions
Challenging
A very safe robot crosses the street. Its rule is: 'IF the light is green AND the 'Walk' sign is on, THEN cross.' The light is green, but the 'Walk' sign is NOT on. What should the robot do?
A.Cross the street anyway
B.Wait
C.Run across quickly
D.Turn off
Challenging
A robot's rule is: 'IF the light is green, THEN check for cars. IF there are no cars, THEN go.' The light is green, but the robot sees a car coming. What should the robot do?
A.Go, because the light is green
B.Go, but go very fast
C.Wait, because there is a car
D.Turn around and go back
Challenging
The rule 'IF the light is green, THEN go' is a type of instruction. Which of these situations works the same way?
A.IF the school bell rings, THEN go to lunch.
B.First you eat, then you play.
C.My favorite color is green.
D.Put your toys away.
Want to practice and check your answers?
Sign up to access all questions with instant feedback, explanations, and progress tracking.
Start Practicing Free