Example 1 — Plan and trace a test-average program
Show the steps and the answer
Start a running total: SET total TO 0.
The scores arrive one at a time, so the algorithm needs a place to keep the sum, and it must start empty.
Repeat for the inputs: FOR i FROM 1 TO 5: INPUT score, SET total TO total + score.
Five scores means the same two actions five times, which is exactly what FOR expresses.
After the loop: SET average TO total / 5. IF average >= 60 THEN PRINT 'Pass' ELSE PRINT 'Retake'.
The division happens once, after all five scores are in; putting it inside the loop would divide partial sums.
Trace: total becomes 72, 127, 191, 239, 320, so average = 320 / 5 = 64.
64 >= 60 is true, so the IF branch runs and the plan prints 'Pass'.
Answer: SET total TO 0; FOR i FROM 1 TO 5: INPUT score, SET total TO total + score; SET average TO total / 5; IF average >= 60 THEN PRINT 'Pass' ELSE PRINT 'Retake'. For 72, 55, 64, 48, 81 it prints 'Pass' (average 64).
Takeaway: Write one action per line, show repeats with FOR and choices with IF, then trace with real numbers to test the logic before any code exists.