AP Review 2

AP Review 2

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Data types

Data types

9th Grade

10 Qs

Java Math and String Libraries

Java Math and String Libraries

9th - 12th Grade

14 Qs

Data Representation - Unit Definitions

Data Representation - Unit Definitions

2nd - 12th Grade

10 Qs

Logic, Binary & Boolean#1

Logic, Binary & Boolean#1

8th - 9th Grade

15 Qs

Data Representation

Data Representation

9th - 11th Grade

15 Qs

QUIZ Pemdas bab 4

QUIZ Pemdas bab 4

12th Grade

15 Qs

Data Science 1&6 4th 9 Weeks Test

Data Science 1&6 4th 9 Weeks Test

9th Grade

15 Qs

Pentaksiran T4(1.3)

Pentaksiran T4(1.3)

11th Grade

15 Qs

AP Review 2

AP Review 2

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Used 49+ times

FREE Resource

10 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

2 mins • 1 pt

Media Image

The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is initially

facing right.

Media Image
Media Image
Media Image
Media Image

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

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?

Media Image
Media Image
Media Image
Media Image

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"

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

The grid contains a robot represented as a triangle, initially facing up. The robot can move into a white or gray square but cannot move into a black region.


The code segment below uses the procedure GoalReached, which evaluates to true if the robot is in the gray square and evaluates to false otherwise.


REPEAT UNTIL (GoalReached ())

{

<MISSING CODE>

}

Which of the following replacements for <MISSING CODE> can be used to move the robot to the gray square?

Media Image
Media Image
Media Image
Media Image

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?