Computer Science Grade 1 20 min

If-Then Statements with Colors

Practice using 'if-then' statements with colors (e.g., If the light is green, then we can go).

What you'll learn

  • Identify the 'If' part and the 'Then' part of a simple If-Then statement related to colors with 80% accuracy.
  • Predict the outcome of 3 out of 4 given If-Then statements that change the color of an object based on a condition.
  • Explain, using color examples, what happens in an If-Then statement with 75% clarity, as assessed by the teacher.

Tutorial Preview

1

Introduction & Learning Objectives

Learning Objectives Identify the 'if' part of a rule. Identify the 'then' part of a rule. Follow a simple If-Then rule using colors. Create their own simple If-Then rule with colors. Explain what happens when an 'if' condition is not met. Sort objects based on color using If-Then logic. Have you ever played a game with rules? 🤔 What if the rule was: IF you see red, THEN you shout 'Hooray!'? 🎉 Today, we will learn about special computer rules called If-Then statements. These rules help computers make smart choices. We will use fun colors to learn how they work! Real-World Applications Traffic lights 🚦: IF the light is red, THEN we stop. Getting dressed 👕: IF it is cold outside, THEN I wear a jacket. Snack time 🍎: IF I am h...
2

Key Concepts & Vocabulary

TermDefinitionExample If-Then StatementA special rule that tells a computer what to do. It has two parts: an 'if' part and a 'then' part.IF the crayon is blue 🖍️, THEN draw the sky. Condition (The 'If' part)The first part of the rule. It's something we check to see if it is true.In our rule, 'IF the crayon is blue', the condition is 'the crayon is blue'. Action (The 'Then' part)The second part of the rule. It's the thing we do only if the 'if' part is true.In our rule, 'THEN draw the sky', the action is 'draw the sky'. RuleA direction that tells you what to do. If-Then statements are a type of rule.A classroom rule is: IF it is story time, THEN we sit quietly. Color CheckLooking at an objec...
3

Core Syntax & Patterns

The Basic If-Then Pattern IF [a color is seen], THEN [do a specific action]. Use this pattern to make a choice. First, check for a color. If you see it, do the action. The 'What If Not?' Pattern IF [a color is seen], THEN [do an action]. If not, do nothing. If the condition is not true, you just move on. You don't have to do the 'then' action.

4 more steps in this tutorial

Sign up free to access the complete tutorial with worked examples and practice.

Sign Up Free to Continue

Sample Practice Questions

Challenging
A robot's rule is: 'IF the cup is RED, THEN fill it with water.' The robot is given a red cup, but it fills it with juice instead. What is the problem?
A.The cup is not red
B.The robot needs a blue cup
C.The robot is not following its rule correctly
D.The rule should be about juice
Challenging
A program has rules in order: Rule 1: IF the shape is a circle, THEN color it YELLOW. Rule 2: IF the shape is YELLOW, THEN draw a happy face on it. What happens if the program is given a circle?
A.It becomes a yellow circle with a happy face
B.It becomes just a yellow circle
C.It becomes a circle with a happy face
D.Nothing happens
Challenging
You want a robot to water ONLY the red flowers and leave the yellow flowers alone. What is the BEST rule for the robot?
A.IF you see a flower, THEN water it
B.IF the flower is pretty, THEN water it
C.IF the flower is RED, THEN water it
D.IF the flower is yellow, THEN don't water it

Want to practice and check your answers?

Sign up to access all questions with instant feedback, explanations, and progress tracking.

Start Practicing Free

More from Logical Reasoning: Thinking Like a Computer

Computer Science for other grades

Frequently asked questions

What grade level is "If-Then Statements with Colors"?

If-Then Statements with Colors is a Grade 1 Computer Science lesson on ExcelOS.

What will I learn in If-Then Statements with Colors?

You'll be able to: Identify the 'If' part and the 'Then' part of a simple If-Then statement related to colors with 80% accuracy; Predict the outcome of 3 out of 4 given If-Then statements that change the color of an object based on a condition….

Is "If-Then Statements with Colors" free to practice?

Yes. You can read the tutorial preview for free, and signing up for a free ExcelOS account unlocks the full tutorial and all practice questions with instant feedback.

How many practice questions are included with If-Then Statements with Colors?

This lesson includes 27 practice questions across multiple difficulty levels, each with instant feedback and explanations.

Ready to find your learning gaps?

Take a free diagnostic test and get a personalized learning plan in minutes.