Six exam-style questions on values, assignment and arithmetic. Some are written in Lua and some in exam notation, and nothing tells you which is coming — the same as in May.
Set a timer for 10 minutes. Work them out on paper and do not run the code. Mark each answer sure or unsure. Guess rather than leave a blank; the AP exam has no penalty for a wrong answer.
What does this display?
x ← 5x ← x + 3DISPLAY(x)5853What does this print?
print("Score: " .. 3 + 4)Score: 34Score: 7Score: 3 423 MOD 4 evaluates to:
55.753419 / 4 evaluates to:
44.7553The person types 12. Which of the following is true?
io.write("How many? ")local n = io.read()n * 3 raises an errorn == 12 evaluates to truen * 3 evaluates to 36n holds the number 12What does this display?
DISPLAY("A")DISPLAY("B")ABA and B on two linesA B on one lineDISPLAY can only be used onceHand in your six answers with sure or unsure beside each, and your time.
The unsure marks are the useful part. A right answer you were unsure of is a topic to revisit; a wrong answer you were sure of is a bigger one.
Worth 4 points, graded on completion.