Ages 10–12 · Growing
Assignment with an old snapshot
Use the evidence in assignment with an old snapshot to select and justify a valid solution.
Understand the idea
Program traces follow assignments and expression rules in order.
Your challenge
x=2; saved=x; x=x+3; result=saved+x. What is result, and why not ten?
- 5 because saved is ignored
- 10 because saved follows x
- 7 because saved retains 2
How to explore
- Keep separate columns for each variable throughout the trace.
- Record the state after each executed operation, respecting the stated evaluation and stopping rules.
- Check the selected response against the complete situation, including a case where a tempting alternative fails.
Open the activity to work with its controls and check your reasoning. Progress stays in this browser.
Keep exploring
DON’T LET THE QUESTION END HEREGive that curiosity
Open the learning space