The lesson

🧑‍🏫 Teacher Guide

The three-branch shape (if / else if / else) is the real content. Draw a number line on the board: under 5, 5 up to 9, 10 and over. Fix It answer: two things are wrong. The wide test comes first, so the narrow one never runs — anything under 5 is already under 10. And the forward block sits in the < 10 branch, so the car drives into your hand. Put < 5 first, and make < 10 stop. The 2 cm floor from last chapter is gone on purpose: a 0 reading now lands in too close, and backing off is the safe answer. Source: ElecFreaks wiki, Case 10 "Car Following with A Fixed Distance".

🟢 Make the gap 20 cm instead. Say which numbers you had to change.
Find the two numbers that set the band → Decide the new pair → Change both → Test that the car still settles
🟡 Add a headlight color for each state: too close, just right, too far.
Recall the headlight block from Level 2 → Pick three colors → Put one in each branch → Check the color changes as you move your hand
🔴 Make the car speed up the further away your hand is, instead of one fixed speed.
Notice the forward speed is a fixed 30 → Work out how the gap could set that number → Try it → Say what happens when your hand is very far away
logic_else_if

Adds another test for when the one above it was false.

if (input.buttonIsPressed(Button.A)) {
    cuteBot.forward()
} else if (input.buttonIsPressed(Button.B)) {
    cuteBot.backforward()
} else {
    cuteBot.stopcar()
}

You see: The first test that is true wins and the rest are skipped.

Answer key

Conceptc1 → A, c2 → C
Readingr1 → B, r2 → B, r3 → D
Debugd1 → A, d2 → A
Buildingb1 → A, b2 → B

Talk rubric

Strong — says a chain stops at the first true test so exactly one branch runs, whereas separate if blocks are all checked and a later one can overwrite an earlier decision. Developing — says only one branch runs in a chain, without saying what goes wrong otherwise. Needs Focus — treats the two forms as equivalent.

A week later

These questions are not on the check-up page. They come back in the next chapter's Warm-up, five days or more after the check-up — with one new program on the same idea each.

Concept 1 🗓️ Comes back a week laterWhat is the difference between else if and a second, separate if? → B else if is only asked when the test before it was false
· New code (same idea)A program says if Sonar < 5 → reverse, else if Sonar < 10 → stop. The sonar reads 3. Is the else if test asked? → A No — the first test was true, so it is skipped
Reading 2 🗓️ Comes back a week laterYour hand is 7cm away. What does the car do? → A Holds still
· New code (same idea)Your hand is 18cm away. What does the car do? → D Holds still