See if students can follow the code.
Students predict what a program prints and what its variables end up as, before they run anything.
What does it do?
Show students a program and ask what it prints and where its variables end up. It’s a quick way to see whether they can follow code before you ask them to write it.
Who is it for?
Introductory CS teachers
Check that students can read code before they write their own.
Students
Practice following loops and variables step by step.
How do I use it?
- Add a Code Tracing activity to your lesson.
- Paste the program and enter its output and variable values.
- Set points and formatting rules, then preview it.
Features
Output and variables
Paste in a program, then ask for its output and the final value of any variables you name.
Answer matching
Ignore case and spacing, so students aren’t marked wrong for formatting.
Related practice
Follow up with a Parsons problem, where students rebuild the program from shuffled lines.
Questions
Do students run the code?
No. They predict the result first. Follow up with a Code Exercise when you want them to run and edit it.
Works with other tools
Use these together in the same course.