← Back to course
Code Crew G3 / Week 03 / Crew Quest
6/6
Week 03 Β· Conditionals

Crew Quest

// If this, then that

Crew Quest: Rule the House

Rocket has a funny idea. "Let's follow house rules like a computer!" he says.

Raven grabs a pencil. "What do you notice that happens every day at home?" she asks.

Nova floats beside them. "A computer follows each rule exactly," she says.

Let's write three house rules with if and then. Then we'll follow them for one hour.

Become the ROBOT in your own house for an hour.

Make 3 'house rules' as IF/ELSE, then OBEY them strictly.

Rule 1: IF __________________ THEN __________________
Rule 2: IF __________________ THEN __________________
Rule 3: IF __________________ THEN __________________

After your robot hour

Crew Brag Box
β˜… Earn a star for each rule you actually followed.
β˜…β˜…β˜… for not breaking any of them.

Week 3 Recap

  1. IF / ELSE lets a program decide.
  2. DECISION TREE = IF / ELSE drawn as a picture.
  3. An IF can live INSIDE another IF (nested).
Try This Without Paper
1. Make a 'house rule' as an IF: IF dishes in the sink β†’ put one away.
2. Play Simon Says; Simon's commands are giant IFs.
3. With a friend: one says IF, the other answers THEN.
β—‡ IF, THEN GAME
One person says a rule, like: IF I touch my nose, THEN you clap.
They do some actions. You follow only the rules that are true.
Add an ELSE: IF I touch my nose, THEN clap. ELSE stomp softly.
Swap roles and make the rules trickier.
Safety first
Play in a clear space.
Keep your moves gentle.
WEEK 3 REVIEW
  • Read the question.
  • Tap your answer.
What does a conditional do?
When does the ELSE step run?
What is an IF inside another IF called?
IF it snows, THEN build a snow fort. ELSE ride bikes. It is not snowing. What do you do?
StatementTrue or false?
A decision tree shows IF and ELSE as boxes and arrows.?
ELSE IF lets a rule ask another question.?
A conditional runs both paths at once.?
Simon Says is a game full of IF rules.?
WHY THIS EXERCISEIF rules are how programs decide what to do.

Coming up next…

Week 4: VARIABLES. Boxes that hold things you can change.

← Friday