Using trace tables (Edexcel GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
What are trace tables?
What are trace tables?
Tools that track variable changes step-by-step as an algorithm runs
What is a 'dry-run'?
What is a 'dry-run'?
Running code without computer, using paper and pencil
What do trace table columns represent?
What do trace table columns represent?
Each variable plus input/output values
Purpose of trace tables
Purpose of trace tables
Debugging algorithms and understanding program flow before running code
How to complete trace tables
How to complete trace tables
Work line by line, update when variables change
Loop execution in trace tables
Loop execution in trace tables
New row for each iteration until condition becomes false
What does each row typically represent?
What does each row typically represent?
One pass through a loop body or one line of execution
When to stop executing a loop
When to stop executing a loop
When loop condition becomes false
After loop condition fails
After loop condition fails
Execution continues with next instruction after loop
What does range(0, 4) generate?
What does range(0, 4) generate?
Values 0, 1, 2, 3 (from 0 up to but not including 4)
Common mistake: updating variables
Common mistake: updating variables
Forgetting to update all variables in each iteration
Common mistake: loop conditions
Common mistake: loop conditions
Not checking loop conditions properly
