Six exam-style questions, mostly about walking through an array — Activities 1.25 and 1.26. These sets are cumulative, so conditions, loops, arithmetic, and Part 0 are all still fair game. This is the last set before the quarter review.
Questions 2 and 3 are a pair: the same scores, the same loop starting at 1, two different answers. One of them is a bug and one of them is correct.
Guessing beats leaving it blank. There is no penalty for a wrong answer on the AP exam, so a blank is a guaranteed zero where a guess is not.
Four have exactly one correct answer, one asks you to select all that apply, and the last is about data or the impact of computing rather than about code.
The following is written in AP exam notation. What does it display?
nums ← [4, 7, 2]
FOR EACH n IN nums{ DISPLAY(n * 2)}8 14 44 7 21326What does the following C# display?
int[] scores = { 7, 3, 9 };int total = 0;
for (int i = 1; i < scores.Length; i++){ total = total + scores[i];}
Console.WriteLine(total);191216The following is written in AP exam notation. What does it display?
scores ← [7, 3, 9]total ← 0i ← 1
REPEAT LENGTH(scores) TIMES{ total ← total + scores[i] i ← i + 1}
DISPLAY(total)191216scores[3] is past the end of the listTwo arrays hold the positions of three invaders, the way Raylib Lab 6 did. What happens when the following C# runs?
int[] xs = { 100, 200, 300 };int[] ys = { 50, 60 };
for (int i = 0; i < xs.Length; i++){ Console.WriteLine($"{xs[i]} {ys[i]}");}
Console.WriteLine("Done");300 0, then DoneIndexOutOfRangeException, and Done is never displayedDoneWhich of these visit every element of aList in AP exam notation?
FOR EACH item IN aListi ← 1, then REPEAT LENGTH(aList) TIMES, with i ← i + 1 as the last line inside the loopfor (int i = 0; i < aList.Length; i++)i ← 1, then REPEAT UNTIL(i > LENGTH(aList)), with i ← i + 1 as the last line inside the loopi ← 0, then REPEAT LENGTH(aList) TIMES, with i ← i + 1 as the last line inside the loopA mapping project asks thousands of volunteers to each trace a few roads from satellite images. This is an example of:
This is graded on completion, not accuracy. A thoughtful wrong answer earns the same as a right one. What is being built here is speed and stamina, and both require being allowed to get things wrong cheaply.