Many computer science paper-and-pencil style tests ask you to "play computer" and in some way describe what would happen if a given program/code were run. We call these questions code tracing questions.
For the APCSP exam, these generally come in two forms:
Non-robot questions generally come in two types as well:
The hardest part about these questions is they ask you to play computer. But computers are specifically good at things humans aren't -- being very picky and keeping track of a lot of details. However, if you can trace what happens when a program executes, it tells your teacher (and you):
Additionally, you use a lot of these code tracing skills when you debug a program.
There's one key rule -- then we will show you several example videos. The key rule is -- don't try to do the problem "in your head". You are almost guaranteed to get a detail wrong. Human brains are just like that -- it's why we built computers.
This example shows loop tracing in textual pseudocode. (8 minutes)
This example is very similar -- but shows a situation where you need to pay attention as you trace. (9 minutes)
This example shows how a tracing question can be asked using only "Display". (3 minutes)