AP Computer Science Principles Multiple Choice Practice (Part 4)

Поделиться
HTML-код
  • Опубликовано: 15 июл 2024
  • Problems taken from apcspths.pbworks.com/w/file/fe...
    Intro: 00:00
    Problem 1: 00:09
    Solving problem 1: 00:36
    Solution to problem 1: 02:03
    Problem 2: 03:03
    Solving problem 2: 04:04
    Solution to problem 2: 07:19
    Problem 3: 08:04
    Solving problem 3: 08:49
    Solution to problem 3: 14:13
    1) A certain social media Web site allows users to post messages and to comment on other messages that have been posted. When a user posts a message, the message itself is considered data. In addition to the data, the site stores the following metadata.
    * The time the message was posted
    * The name of the user who posted the message
    * The names of any users who comment on the message and the times the comments were made
    For which of the following goals would it be more useful to analyze the data instead of the metadata?
    (A) To determine the users who post messages most frequently
    (B) To determine the time of day that the site is most active
    (C) To determine the topics that many users are posting about
    (D) To determine which posts from a particular user have received the greatest number of comments
    2) The figure below shows a robot in a grid of squares. The robot is represented as a triangle, which is initially facing upward. The robot can move into a white or gray square but cannot move into a black region.
    Consider the procedure MoveAndTurn below:
    PROCEDURE MoveAndTurn numMoves, numTurns
    REPEAT numMoves TIMES
    MOVE_FORWARD
    REPEAT numTurns TIMES
    ROTATE_RIGHT
    Which of the following shows the location of the robot after running the code segment?
    A) MoveAndTurn(1, 2)
    MoveAndTurn(3, 4)
    MoveAndTurn(0, 2)
    B) MoveAndTurn(2, 1)
    MoveAndTurn(4, 1)
    MoveAndTurn(2, 0)
    C) MoveAndTurn(2, 1)
    MoveAndTurn(4, 3)
    MoveAndTurn(2, 0)
    D) MoveAndTurn(3, 1)
    MoveAndTurn(5, 3)
    MoveAndTurn(3, 0)
    3) An office building has two floors. A computer program is used to control an elevator that travels between the two floors. Physical sensors are used to set the following Boolean variables.
    onFloor1 | set to true if the elevator is stopped on foor 1; otherwise set to false
    onFloor2 | set to true if the elevator is stopped on foor 2; otherwise set to false
    callTo1 | set to true if the elevator is called to foor 1; otherwise set to false
    callTo2 | set to true if the elevator is called to foor 2; otherwise set to false
    The elevator moves when the door is closed and the elevator is called to the floor that it is not currently on. Which of the following Boolean expressions can be used in a selection statement
    to cause the elevator to move?
    (A) (onFloor1 AND callTo2) AND (onFloor2 AND callTo1)
    (B) (onFloor1 AND callTo2) OR (onFloor2 AND callTo1)
    (C) (onFloor1 OR callTo2) AND (onFloor2 OR callTo1)
    (D) (onFloor1 OR callTo2) OR (onFloor2 OR callTo1)

Комментарии • 1

  • @itsyournetanya
    @itsyournetanya 8 месяцев назад +1

    Keep doing what you're doing!