Back to Challenge Set 14

Question Set 8

Difficulty  

divider

What This Is

Six exam-style questions on the whole quarter, Activities 1.1 through 1.26. This one is shaped like the real thing: C# and exam notation mixed together, topics in no order, and no warning about which is which.

It is your last practice before the Quarter 1 checkpoint, so do it before Activity 1.27, not after.

How to Do This One

  • Set a timer for 10 minutes before you start — the same as Question Sets 6 and 7.
  • When the timer ends, stop. Mark anything unfinished as unfinished — that is real information, not a failure.
  • Work them out. Do not run the code. On exam day there is no computer.
  • For each question, also write sure or unsure. This is graded on completion, so an honest unsure costs you nothing and tells us both where to look.

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.


The Questions

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.


Question 1

What does the following display?

Question 1
scores ← [80, 95, 70]
best ← scores[1]
FOR EACH s IN scores
{
IF(s > best)
{
best ← s
}
}
DISPLAY(best)
  1. 80
  2. 95
  3. 70
  4. 245

Question 2

What does the following display?

Question 2
int total = 7;
int count = 2;
double average = total / count;
Console.WriteLine($"{average:F1}");
  1. 3.5
  2. 3.0
  3. 3
  4. 4.0

Question 3 — Select all that apply

Which of these are true about DISPLAY on the AP exam reference sheet?

  1. It puts a space after the value it shows
  2. It starts a new line after each call
  3. Two calls in a row put their output on one line
  4. It works the same way as C#'s Console.WriteLine
  5. It can show the result of an expression, such as DISPLAY(a + b)

Question 4

A robot faces up on an open grid. It runs ROTATE_RIGHT(), ROTATE_RIGHT(), then MOVE_FORWARD(). Which way has it moved?

  • (A) Up one square
  • (B) Down one square
  • (C) Right one square
  • (D) Left one square

Question 5

What is true about the following C#?

Question 5
int n = 10;
while (n > 0)
{
Console.WriteLine(n);
}
  • (A) It is not infinite; it displays ten numbers and stops.
  • (B) It is infinite, because nothing inside the loop changes n.
  • (C) It is infinite, because a while loop always repeats forever.
  • (D) It is infinite, because n starts above zero.

Question 6 — Data and Impact

A navigation app knows where all its users are. That lets it route drivers around traffic jams, and it also lets it record where each user was on any given day. This best shows that:

  • (A) An innovation's effects are either beneficial or harmful, not both
  • (B) The same feature can have both a beneficial and a harmful effect
  • (C) Harmful effects only happen when a company intends them
  • (D) Location data is always anonymous

Submit

  • Your answer to each question, with sure or unsure
  • Whether you finished inside 10 minutes, and if not, how far you got
  • One sentence: which question took you longest, and what slowed you down?

This is graded on completion, not accuracy. Bring your answers to Activity 1.27: the questions you marked unsure are the ones to look at before the checkpoint.

Start the Timer