_Session_2_CSP_2023_AP_Daily_Practice_Sessions_
_Session_2_CSP_2023_AP_Daily_Practice_Sessions_
2. A video game character can face toward one of four directions: north, south, east, and
west. Each direction is stored in memory as a sequence of four bits. A new version of
the game is created in which the character can face toward one of eight directions,
adding northwest, northeast, southwest, and southeast to the original four possibilities.
Which of the following statements is true about how the eight directions must be stored
in memory?
A. Four bits are not enough to store the eight directions. Five bits are needed for
the new version of the game.
B. Four bits are not enough to store the eight directions. Eight bits are needed for
the new version of the game.
C. Four bits are not enough to store the eight directions. Sixteen bits are needed
for the new version of the game.
D. Four bits are enough to store the eight directions.
Which of the following lists the values in order from least to greatest?
A. Decimal 5, binary 1011, decimal 12, binary 1101
B. Decimal 5, decimal 12, binary 1011, binary 1101
C. Decimal 5, binary 1011, binary 1101, decimal 12
D. Binary 1011, binary 1101, decimal 5, decimal 12
5. A student is creating a Web site that is intended to display information about a city
based on a city name that a user enters in a text field.
Which of the following are likely to be challenges associated with processing city
names that users might provide as input? Select TWO answers.
A. Users might attempt to use the Web site to search for multiple cities.
B. Users might enter abbreviations for the names of cities.
C. Users might misspell the name of the city.
D. Users might be slow at typing a city name in the text field.
6. A camera mounted on the dashboard of a car captures an image of the view from the
driver’s seat every second. Each image is stored as data. Along with each image, the
camera also captures and stores the car’s speed, the date and time, and the car’s
GPS location as metadata.
Which of the following can best be determined using only the data and none of the
metadata?
A. The average number of hours per day that the car is in use
B. The car’s average speed on a particular day
C. The distance the car traveled on a particular day
D. The number of bicycles the car passed on a particular day
7. A large spreadsheet contains information about the schedule for a college radio
station. A sample portion of the spreadsheet is shown below.
A student wants to count the number of shows that meet both of the following criteria.
• Is a talk show
• Is on Saturday or Sunday
For a given row in the spreadsheet, suppose genre contains the genre as a string
and day contains the day as a string. Which of the following expressions will
evaluate to true if the show should be counted and evaluates to false otherwise?
A. (genre = "talk") AND ((day = "Saturday") AND (day = "Sunday"))
B. (genre = "talk") AND ((day = "Saturday") OR (day = "Sunday"))
C. (genre = "talk") OR ((day = "Saturday") AND (day = "Sunday"))
D. (genre = "talk") OR ((day = "Saturday") OR (day = "Sunday"))
8. Consider the following code segment, which is intended to store ten consecutive even
integers, beginning with 2, in the list evenList.
Which of the following can be used to replace <MISSING CODE> so that the code
segment works as intended?
A. APPEND(evenList, i)
i ← i + 2
B. i ← i + 2
APPEND(evenList, i)
C. APPEND(evenList, 2 * i)
i ← i + 1
D. i ← i + 1
APPEND(evenList, 2 * i)
9. The list listOne is a sorted list of numbers that contains 700 elements. The
list listTwo is a sorted list of numbers that contains 900 elements. Let x represent
the maximum number of list elements that will need to be examined when performing
a binary search for a value in listOne, and let y represent the maximum number of
list elements that will need to be examined when performing a binary search for a
value in listTwo.
Which of the following code segments will set the variable found to true if at least
one student scored the maximum possible number of points on the quiz and will
set found to false otherwise?
A. C.
B. D.
Upon compiling the data, the researcher identifies a problem due to the fact that
neither data source uses a unique ID number for each student.
Which of the following best describes the problem caused by the lack of unique ID
numbers?
A. Students who have the same name may be confused with each other.
B. Students who have the same grade point average may be confused with each
other.
C. Students who have the same grade level may be confused with each other.
D. Students who have the same number of absences may be confused with each
other.