Code Crew G3 / Week 03 / Wednesday
3/6
Week 03 · Conditionals

Wednesday

// If this, then that

Nested Conditionals

Sometimes one IF lives INSIDE another IF. Read this carefully:

IF the door is open:
    IF the dog is inside:
        say 'Hi, dog!'
    ELSE:
        whistle for the dog
ELSE:
    knock on the door

Answer these

Door open, dog inside → ____________________
Door open, dog NOT inside → ____________________
Door closed → ____________________

Thursday: Traffic Light Puzzle

What do you do at each light? Match the color to the action.

IF light is RED → __________________________
IF light is YELLOW → ______________________
IF light is GREEN → ________________________

Tricky one

What if the light is BROKEN (not red, yellow, or green)?

Write a NEW conditional for that case.

ELSE (light is broken) →
Try Without Paper
Walk through your house. Make up an IF rule for one room.
Example: 'IF the lights are off in my room, THEN the day is over.'
← Tuesday