You are on page 1of 1

Code Tracer: Variables VHS Learning Page 1 of 1

Name: (Your first and last name) Course Name: (Name of this course)

Teacher: (Your teacher's name) Date:      

Directions: For each situation, explain (in at least 3 complete sentences) to someone who does not know
programming what the program of code is doing. If the program, returns/prints a value, make sure to include that
in your explanation.

Situation A
myPoints ← 2 (output of code)
myPoints ← 5
myPoints ← myPoints + 1 (Explanation of what the code is doing for someone who doesn't know
DISPLAY myPoints code)
Situation B
fly ← "to" + "day" (output of code)
zow ← 4 - 1
fly ← 3 * 3 (Explanation of what the code is doing for someone who doesn't know
zow ← 4 + "now" code)
DISPLAY (fly)
DISPLAY (zow)
Situation C
kit ← 1 (output of code)
boo ← kit + 1
kit ← 5 (Explanation of what the code is doing for someone who doesn't know
DISPLAY (kit) code)
DISPLAY (boo)
Situation D
fuzz ← 5 (output of code)
clip ← fuzz + 2
fuzz ← clip + 1 (Explanation of what the code is doing for someone who doesn't know
clip ← "gr" code)
fuzz ← fuzz + 1
fuzz ← fuzz + 1
fuzz ← fuzz + 1
DISPLAY (fuzz)
DISPLAY (clip)

Situation E
fuzz ← 6 (output of code)
clip ← "gr"
fuzz ← fuzz / 2 (Explanation of what the code is doing for someone who doesn't know
fuzz ← 42 code)
DISPLAY (clip + fuzz)
DISPLAY ("clip" + fuzz)

Note: AP Psuedocode should always use a monospaced font like "Courier New"

Page 1 of 1 © VHS, Inc.

You might also like