Pseudocode Tracer lesson plans

Each one is a class period with everything to run it: a teacher plan, a student worksheet, an exit ticket with answers, and the standards it meets. Students need no account, and a free class saves their work.

Free

Pseudocode Tracer: Assignment Is a Copy

Grades 9-12 · 45 minutes · Computer science

The AP CSP exam asks students to trace code written in the exam reference sheet's own notation, and the very first rule they need is what the arrow does. The CED's own example (AAP-1.B.3) is a ← 1, b ← a, a ← 2, DISPLAY(b): it still displays 1, and many students say 2. In this lesson students trace short programs in a step-by-step tracer that runs the reference sheet's notation exactly. At the lines marked with a question mark, the tracer stops and asks what the variable will hold or what will be displayed, and checks the answer before it runs the line. Students find that assignment copies a value instead of linking two names, that a variable holds only its most recent value, why a swap needs a third variable, and how MOD and division work on the exam. They finish with exam-style questions whose wrong choices come from running each common mistake.