Rocket and Raven play tag in the park. Rocket gets one point for a tag. Raven gets two points. A miss takes one point away.
"I'll remember all the scores!" Rocket says. Soon he mixes them up.
"What do you notice?" Raven asks. "We need a box for each player."
Nova nods. "Good names help too," she says. Let's track every round. Then we'll pick the best names.
Rocket and Raven are playing tag. Track each player's score in a variable.
ROCKET tag = +1. RAVEN tag = +2. MISS = -1.
| Round | Event | rocket_score | raven_score |
|---|---|---|---|
| Start | (none) | 0 | 0 |
| 1 | Rocket tags Raven | ? | ? |
| 2 | Raven tags Rocket | ? | ? |
| 3 | Rocket misses | ? | ? |
| 4 | Raven tags Rocket | ? | ? |
| 5 | Rocket tags Raven | ? | ? |
A good variable name TELLS YOU what's inside. Which name is best?
Circle one for each.
Tracing means changing the box one line at a time. Write the new value after every line.
points = 0 points = points + 2 points = points + 2 points = points - 1 points = points + 3
| Statement | True or false? |
|---|---|
| A good name tells you what is inside the box. | ? |
| Short names are always the best names. | ? |
| Tracing means following code one line at a time. | ? |
| A score box can go down when a player misses. | ? |