
AP CSP #21-26
Authored by Robert Reed
Computers
10th - 12th Grade
Used 59+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
An application program interface (API) provides a procedure Max, which returns the greater of its two integer arguments. A programmer would like to find the greatest of three integer values a, b, and c. Which of the following expressions will produce the desired result in every case?
Max (Max (a, b), c)
Max (a, b) - Max (b, c)
Max (a, b) + Max (b, c) – Max (a, c)
(Max (a, b) + Max (b, c)) / 2
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is initially facing right. Which of the following code segments will move the robot to the gray square?
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A student is creating a procedure to determine whether the weather for a particular month was considered very hot. The procedure takes as input a list containing daily high temperatures for a particular month. The procedure is intended to return true if the daily high temperature was at least 90 degrees for a majority of days in the month and return false otherwise. Which of the following can be used to replace <MISSING CODE> so that the procedure works as intended?
counter < 0.5 * total
counter > 0.5 * total
total < 0.5 * counter
total > 0.5 * counter
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The following figures represent different ways of configuring a network of physically linked computers labeled P, Q, R, and S. A line between two computers indicates that the computers can communicate directly with each other. In which configuration is it NOT possible to have redundant routing between computers P and S?
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Byte pair encoding is a data encoding technique. The encoding algorithm looks for pairs of characters that appear in the string more than once and replaces each instance of that pair with a corresponding character that does not appear in the string. The algorithm saves a list containing the mapping of character pairs to their corresponding replacement characters.
For example, the string "THIS_IS_THE_BEST_WISH" can be encoded as "%#_#_%E_BEST_W#H" by replacing all instances of "TH" with "%" and replacing all instances of "IS" with "#".
Which of the following statements about byte pair encoding is true?
Byte pair encoding is an example of a lossy transformation because it discards some of the data in the original string.
Byte pair encoding is an example of a lossy transformation because some pairs of characters are replaced by a single character.
Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version.
Byte pair encoding is an example of a lossless transformation because it can be used to transmit messages securely.
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Byte pair encoding is a data encoding technique. The encoding algorithm looks for pairs of characters that appear in the string more than once and replaces each instance of that pair with a corresponding character that does not appear in the string. The algorithm saves a list containing the mapping of character pairs to their corresponding replacement characters.
For example, the string "THIS_IS_THE_BEST_WISH" can be encoded as "%#_#_%E_BEST_W#H" by replacing all instances of "TH" with "%" and replacing all instances of "IS" with "#".
For which of the following strings is it NOT possible to use byte pair encoding to shorten the string’s length?
"BANANA"
"LEVEL_UP"
"MEET_ME_LATER"
"NEITHER_HERE_NOR_THERE"
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?