Rewrite short C# programs 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.
You will never write this notation in a real program. You only need to read it fluently, because that is what the multiple-choice section is made of. Translating in this direction is how reading gets easy.
Everything 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 MOD bRANDOM(a, b)Three rules that catch people:
int total = 12 + 8;Console.WriteLine(total);total ← 12 + 8DISPLAY(total)Two lines in, two lines out. Notice what disappeared: int and the semicolons.
Write the exam-notation version of each program. Line for line where you can.
int itemsSold = 15;Console.WriteLine(itemsSold);Careful with the last line. An interpolated string that mixes label text with a value does not stay one statement — exam notation has no $"...".
int cookiesBaked = 53;int boxSize = 8;int extra = cookiesBaked % boxSize;Console.WriteLine($"Left over: {extra}");Keep the parentheses. They mean the same thing in both notations.
int a = 9;int b = 4;int c = (a + b) * 2;Console.WriteLine($"Result: {c}");This one is already in exam notation. Write down exactly what it displays, in order.
x ← 17y ← 5DISPLAY(x / y)DISPLAY(x MOD y)Both answers are different numbers, and neither one is a whole-number division. Work them out by hand before checking — and remember Activity 1.6's lesson about / runs backward here. C# truncates int / int unless you force real division; the exam's / never truncates at all, on any two numbers.
Handwritten and photographed is fine, and is the closest thing to exam conditions.