Big idea: Grade 7 students read and alter existing code, including code with events influenced by a defined count and/or sub-programs and other control structures, and describe how changes affect the outcomes and the efficiency of the code (C3.2). Reading code carefully is as important as writing it.
Common difficulties:
- Conditions with = when the counter skips that number (infinite loops). Suggest ≥ or ≤.
- Line order: adding to a counter before or after a check changes the outcome.
- Confusing shorter with more efficient. Efficiency is about both lines and steps; two programs can be the same length but take very different numbers of steps.
How to help: Play the code swap game. When your child alters code, ask "What do you predict?" first, then "Why was your prediction right or wrong?" Treat bugs as puzzles, not failures. This lesson builds A1 skills: managing frustration while debugging, persevering and explaining reasoning.