Read and write decisions in the notation the AP exam uses. No computer needed — this one works on paper, and doing it on paper is closer to the real thing.
This is the hardest translation in the course, and it is worth knowing that going in. The reference sheet has no else if. Every chain you write in C# has to be rebuilt as nested blocks, and every chain you read on the exam will be drawn that way.
else if chain as nested IF/ELSE blocksEverything from the exam reference sheet that we have covered so far. Nothing else appears in these problems.
a ← expressionDISPLAY(expression)a = b a ≠ ba > b a < ba ≥ b a ≤ bIF(condition){ ...}ELSE{ ...}Three rules that catch people:
int age = 20;
if (age >= 18){ Console.WriteLine("Adult");}else{ Console.WriteLine("Minor");}age ← 20
IF(age ≥ 18){ DISPLAY("Adult")}ELSE{ DISPLAY("Minor")}The braces sit in the same places and ELSE is on its own line in both. Notice what disappeared: int, the semicolons, and the quotes around Console.WriteLine. Notice what changed: = became ←, and >= became ≥.
This is already in exam notation. Write down exactly what it displays.
temp ← 55
IF(temp > 70){ DISPLAY("Warm")}ELSE{ DISPLAY("Cool")}Read the condition carefully. This is the one place the two notations disagree about a single character, and reading it as C# gives the wrong answer.
a ← 8b ← 8
IF(a = b){ DISPLAY("same")}ELSE{ DISPLAY("different")}Rewrite this C# in exam notation. Remember there is no ELSE IF — the chain has to become nested IF and ELSE blocks. Your answer will be taller than the original, and the closing braces will stack up at the bottom. That is correct, not a mistake.
int speed = 45;
if (speed > 70){ Console.WriteLine("Too fast");}else if (speed > 40){ Console.WriteLine("Fine");}else{ Console.WriteLine("Too slow");}This is what your Problem 3 answer should look like, one level deeper. Write down exactly what it displays, in order.
score ← 73
IF(score ≥ 90){ DISPLAY("A")}ELSE{ IF(score ≥ 80) { DISPLAY("B") } ELSE { IF(score ≥ 70) { DISPLAY("C") } ELSE { DISPLAY("F") } }}DISPLAY("Recorded")The trick, if you need one: find the deepest ELSE and read it as “none of the conditions above were true.” Then work out which single condition the score actually satisfies first. Two things get displayed here, and the second one is the reason the last line sits outside every brace.
Handwritten and photographed is fine, and is the closest thing to exam conditions.