Skip to content
StudyFame

AP CSP MCQ Practice Test 3 with Answers

Each question has four options. Pick one to check your answer, or click Show answer to see the answer with an explanation. This test covers binary numbers, public-key encryption, heuristics, simulations, data, the digital divide and procedures.

  1. 1. Three 0s are added to the right end of a positive binary number. For example, 101 becomes 101000. How does the new value compare with the original value?

  2. 2. Priya wants to receive secret messages over the Internet using public-key encryption. Which description is correct?

  3. 3. A delivery company must visit 100 locations. Algorithm I checks every possible route and picks the shortest one. Algorithm II always goes to the nearest location not yet visited. Which statement is true?

  4. 4. An experiment gives result X with probability 25% and result Y with probability 75%. Every trial gives exactly one of the two. This code is meant to simulate 100 trials:

    xCount ← 0
    yCount ← 0
    REPEAT 100 TIMES
    {
      IF (RANDOM(1, 4) = 1)
      { xCount ← xCount + 1 }
      IF (RANDOM(1, 4) > 1)
      { yCount ← yCount + 1 }
    }

    Which change makes the simulation correct?

  5. 5. A city stores the month, the year and the category (moving or non-moving violation) of every traffic ticket. Which question can NOT be answered using only this data?

  6. 6. Which of the following is NOT a reason why it is hard to completely remove personal information once it is on the Internet?

  7. 7. Which of these can NOT be displayed by this code segment? RANDOM(1, 10) returns a random whole number from 1 to 10.

    num ← RANDOM(1, 10)
    IF (num < 4)
    { DISPLAY("tomato") }
    ELSE
    {
      IF (num > 8)
      { DISPLAY("potato") }
      ELSE
      {
        IF (num < 3)
        { DISPLAY("carrot") }
        ELSE
        { DISPLAY("onion") }
      }
    }
  8. 8. For which task is a computer simulation LEAST suitable?

  9. 9. A school wants to give each of its 100 students a unique ID made of bits. What is the minimum number of bits needed?

  10. 10. Which action is most likely to make the digital divide worse?

  11. 11. Which of the following is an example of crowdsourcing?

  12. 12. What is displayed when this code segment runs?

    myList ← [5, 2, 8, 7, 3, 6, 1]
    total ← 0
    FOR EACH item IN myList
    {
      total ← total + (item MOD 2)
    }
    DISPLAY(total)
  13. 13. A hidden program secretly records every key a user presses and sends the recording to another person. What is the main risk?

  14. 14. A program adds 0.1 and 0.2 and displays 0.30000000000000004 instead of 0.3. What is the most likely reason?

  15. 15. A robot starts at a square facing right. Nothing blocks it.

    PROCEDURE botStepper(n)
    {
      REPEAT n TIMES
      { MOVE_FORWARD() }
      ROTATE_LEFT()
      REPEAT n TIMES
      { MOVE_FORWARD() }
      ROTATE_RIGHT()
    }
    
    botStepper(2)
    botStepper(1)

    Where does the robot end?