Six exam-style questions, mostly about loops — Activity 1.17. These sets are cumulative, so randomness, conditions, and Part 0 are all still fair game.
The AP exam gives you 70 questions in 120 minutes, which is 1 minute 43 seconds each.
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. Thirteen of the exam's seventy questions look like that last one, so it is on every set from here on.
Which of the following loops never stop?
int n = 5;
while (n > 0){ Console.WriteLine(n);}int n = 5;
while (n > 0){ n = n - 1;}int n = 5;
while (n != 0){ n = n - 2;}int n = 0;
while (n < 3){ n = n + 1;}The following is written in AP exam notation. How many times does the body of this loop run?
count ← 3
REPEAT UNTIL(count = 0){ DISPLAY(count) count ← count - 1}023What does the program in Question 2 display?
3 2 13 2 1 02 1 01 2 3A student translates while (x < 10) from C# into exam notation as REPEAT UNTIL(x < 10). What have they done wrong?
REPEAT UNTIL runs until its condition becomes true, so the condition must be inverted to x ≥ 10.REPEAT UNTIL requires a counter variable.< is not a valid operator in exam notation.What does the following C# display?
int fuel = 0;
while (fuel < 500){ fuel = fuel + 120;}
Console.WriteLine(fuel);480500600Which of the following is the best description of a computing innovation?
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.