Using trace tables (Edexcel GCSE Computer Science): Flashcards

📚Flashcards
Using trace tables
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

12 cards from this deck

Show

What are trace tables?

Tools that track variable changes step-by-step as an algorithm runs

What is a 'dry-run'?

Running code without computer, using paper and pencil

What do trace table columns represent?

Each variable plus input/output values

Purpose of trace tables

Debugging algorithms and understanding program flow before running code

How to complete trace tables

Work line by line, update when variables change

Loop execution in trace tables

New row for each iteration until condition becomes false

What does each row typically represent?

One pass through a loop body or one line of execution

When to stop executing a loop

When loop condition becomes false

After loop condition fails

Execution continues with next instruction after loop

What does range(0, 4) generate?

Values 0, 1, 2, 3 (from 0 up to but not including 4)

Common mistake: updating variables

Forgetting to update all variables in each iteration

Common mistake: loop conditions

Not checking loop conditions properly

Join 100,000+ GCSE students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.