ap comp sci principles unit one

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

The player controls in a particular video game are represented by numbers. The controls and their corresponding binary values are shown in the following table. ControlBinary Value←01000↑01001→01011↓01111Jump11000Run11001Pause11011Reset11111 The numeric values for the controls can also be represented in decimal (base 10). A ← B ↑ C → D ↓

A color in a computing application is represented by an RGB triplet that describes the amount of red, green, and blue, respectively, used to create the desired color. A selection of colors and their corresponding RGB triplets are shown in the following table. Each value is represented in decimal (base 10). Color NameRGB Tripletindigo (75, 0, 130)ivory(255, 255, 240)light pink(255, 182, 193)​light yellow(255, 255, 224)magenta(255, 0, 255)neutral gray(127, 127, 112)pale yellow(255, 255, 160)vivid yellow(255, 255, 14) What is the binary RGB triplet for the color indigo? A (00100101, 00000000, 10000010) B (00100101, 00000000, 01000001) C (01001011, 00000000, 10000010) D (01001011, 00000000, 01000001)

(01001011, 00000000, 10000010)

Each student that enrolls at a school is assigned a unique ID number, which is stored as a binary number. The ID numbers increase sequentially by 1 with each newly enrolled student. If the ID number assigned to the last student who enrolled was the binary number 1001 0011, what binary number will be assigned to the next student who enrolls? A 1001 0100 B 1001 0111 C 1101 0100 D 1101 0111

1001 0100

A video-streaming Web site uses 32-bit integers to count the number of times each video has been played. In anticipation of some videos being played more times than can be represented with 32 bits, the Web site is planning to change to 64-bit integers for the counter. Which of the following best describes the result of using 64-bit integers instead of 32-bit integers? A 2 times as many values can be represented. B 32 times as many values can be represented. C 232 times as many values can be represented. D 322 times as many values can be represented.

2 times as many values can be represented.

In which of the following situations would it be most appropriate to choose lossy compression over lossless compression? Storing digital photographs to be printed and displayed in a large format in an art gallery B Storing a formatted text document to be restored to its original version for a print publication C Storing music files on a smartphone in order to maximize the number of songs that can be stored D Storing a video file on an external device in order to preserve the highest possible video quality

Storing music files on a smartphone in order to maximize the number of songs that can be stored

A user wants to save a data file on an online storage site. The user wants to reduce the size of the file, if possible, and wants to be able to completely restore the file to its original version. Which of the following actions best supports the user's needs? A Compressing the file using a lossless compression algorithm before uploading it B Compressing the file using a lossy compression algorithm before uploading it C Compressing the file using both lossy and lossless compression algorithms before uploading it D Uploading the original file without using any compression algorithm

Compressing the file using a lossy compression algorithm before uploading it

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 can be encoded as by replacing all instances of with and replacing all instances of with . Which of the following statements about byte pair encoding is true? A Byte pair encoding is an example of a lossy transformation because it discards some of the data in the original string. B Byte pair encoding is an example of a lossy transformation because some pairs of characters are replaced by a single character. C Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version. D Byte pair encoding is an example of a lossless transformation because it can be used to transmit messages securely.

Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version.

An online store uses 6-bit binary sequences to identify each unique item for sale. The store plans to increase the number of items it sells and is considering using 7-bit binary sequences. Which of the following best describes the result of using 7-bit sequences instead of 6-bit sequences? A 2 more items can be uniquely identified. B 10 more items can be uniquely identified. C 2 times as many items can be uniquely identified. D 10 times as many items can be uniquely identified.

2 times as more items can be identified

Internet protocol version 4 (IPv4) represents each IP address as a 32-bit binary number. Internet protocol version 6 (IPv6) represents each IP address as a 128-bit binary number. Which of the following best describes the result of using 128-bit addresses instead of 32-bit addresses? A 4 times as many addresses are available. B 96 times as many addresses are available. C times as many addresses are available. D times as many addresses are available.

2 to the 96 power times as many addresses are available.

The player controls in a particular video game are represented by numbers. The controls and their corresponding binary values are shown in the following table. ControlBinary Value←01000↑01001→01011↓01111Jump11000Run11001Pause11011Reset11111 The numeric values for the controls can also be represented in decimal (base 10). What is the decimal value for the jump control? A 3 B 12 C 24 D 48

24

A store uses binary numbers to assign a unique binary sequence to each item in its inventory. What is the minimum number of bits required for each binary sequence if the store has between 75 and 100 items in its inventory? A 5 B 6 C 7 D 8

7

An office uses an application to assign work to its staff members. The application uses a binary sequence to represent each of 100 staff members. What is the minimum number of bits needed to assign a unique bit sequence to each staff member? A 5 B 6 C 7 D 8

7

Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case. A text-editing application uses binary sequences to represent each of 200 different characters. What is the minimum number of bits needed to assign a unique bit sequence to each of the possible characters? A 4 B 6 C 7 D 8

8

A person wants to transmit an audio file from a device to a second device. Which of the following scenarios best demonstrates the use of lossless compression of the original file? A A device compresses the audio file before transmitting it to a second device. The second device restores the compressed file to its original version before playing it. B A device compresses the audio file by removing details that are not easily perceived by the human ear. The compressed file is transmitted to a second device, which plays it. C A device transmits the original audio file to a second device. The second device removes metadata from the file before playing it. D A device transmits the original audio file to a second device. The second device plays the transmitted file as is.

A device compresses the audio file before transmitting it to a second device. The second device restores the compressed file to its original version before playing it.

Which of the following best explains how an analog audio signal is typically represented by a computer? An analog audio signal is measured as input parameters to a program or procedure. The inputs are represented at the lowest level as a collection of variables. B An analog audio signal is measured at regular intervals. Each measurement is stored as a sample, which is represented at the lowest level as a sequence of bits. C An analog audio signal is measured as a sequence of operations that describe how the sound can be reproduced. The operations are represented at the lowest level as programming instructions. D An analog audio signal is measured as text that describes the attributes of the sound. The text is represented at the lowest level as a string.

An analog audio signal is measured at regular intervals. Each measurement is stored as a sample, which is represented at the lowest level as a sequence of bits.

A certain programming language uses 4-bit binary sequences to represent nonnegative integers. For example, the binary sequence 0101 represents the corresponding decimal value 5. Using this programming language, a programmer attempts to add the decimal values 14 and 15 and assign the sum to the variable total. Which of the following best describes the result of this operation? A The correct sum of 29 will be assigned to the variable total. B An overflow error will occur because 4 bits is not large enough to represent either of the values 14 or 15. C An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15. D A round-off error will occur because the decimal values 14 and 15 are represented as approximations due to the fixed number of bits used to represent numbers.

An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15.

Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case. Digital images are often represented by the red, green, and blue values (an RGB triplet) of each individual pixel in the image. A photographer is manipulating a digital image and overwriting the original image. Which of the following describes a lossless transformation of the digital image? Compressing the image in a way that may lose information but will suffer only a small loss of image quality. B Creating the gray scale of an image by averaging the amounts of red, green, and blue in each pixel and assigning this new value to the corresponding pixel in the new image. The new value of each pixel represents a shade of gray, ranging from white to black. C Creating the negative of an image by creating a new RGB triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed. D Modifying part of the image by taking the pixels in one part of the picture and copying them to the pixels in another part of the picture.

Creating the negative of an image by creating a new RGB triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed.

Consider the following numeric values. Binary 1011 Binary 1101 Decimal 5 Decimal 12 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

Decimal 5, binary 1011, decimal 12, binary 1101

Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case. Some programming languages use constants, which are variables that are initialized at the beginning of a program and never changed. Which of the following are good uses for a constant?I. To represent the mathematical value π (pi) as 3.14II. To represent the current score in a gameIII. To represent a known value such as the number of days in a week A I and II only B I and III only C II and III only D I, II, and III

I and III only

Which of the following are true statements about the data that can be represented using binary sequences? Binary sequences can be used to represent strings of characters. Binary sequences can be used to represent colors. Binary sequences can be used to represent audio recordings. A I only B I and II only C II and III only D I, II, and III

I, II, and III

Which of the following can be represented by a sequence of bits? An integer An alphanumeric character A machine language instruction A I only B III only C I and II only D I, II, and III

I, II, and III

Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case. A computer program uses 4 bits to represent nonnegative integers. Which of the following statements describe a possible result when the program uses this number representation? I. The operation will result in an overflow error. II. The operation will result in an overflow error. III. The operation will result in an overflow error. A I only B II only C II and III only D I, II, and III

II only

A color in a computing application is represented by an RGB triplet that describes the amount of red, green, and blue, respectively, used to create the desired color. A selection of colors and their corresponding RGB triplets are shown in the following table. Each value is represented in decimal (base 10). Color NameRGB Tripletindigo (75, 0, 130)ivory(255, 255, 240)light pink(255, 182, 193)​light yellow(255, 255, 224)magenta(255, 0, 255)neutral gray(127, 127, 112)pale yellow(255, 255, 160)vivid yellow(255, 255, 14) According to information in the table, what color is represented by the binary RGB triplet (11111111, 11111111, 11110000) ? A Ivory B Light yellow C Neutral gray D Vivid yellow

Ivory

ASCII is a character-encoding scheme that uses 7 bits to represent each character. The decimal (base 10) values 65 through 90 represent the capital letters A through Z, as shown in the table below. What ASCII character is represented by the binary (base 2) number 1001010 ? A H B I C J D K

J / 74

A programmer is developing software for a social media platform. The programmer is planning to use compression when users send attachments to other users. Which of the following is a true statement about the use of compression? A Lossless compression of video files will generally save more space than lossy compression of video files. B Lossless compression of an image file will generally result in a file that is equal in size to the original file. C Lossy compression of an image file generally provides a greater reduction in transmission time than lossless compression does. D Sound clips compressed with lossy compression for storage on the platform can be restored to their original quality when they are played.

Lossy compression of an image file generally provides a greater reduction in transmission time than lossless compression does.

A program developed for a Web store represents customer account balances using a format that approximates real numbers. While testing the program, a software developer discovers that some values appear to be mathematically imprecise. Which of the following is the most likely cause of the imprecision? A The account balances are represented using a fixed number of bits, resulting in overflow errors. B The account balances are represented using a fixed number of bits, resulting in round-off errors. C The account balances are represented using an unlimited number of bits, resulting in overflow errors. D The account balances are represented using an unlimited number of bits, resulting in round-off errors.

The account balances are represented using a fixed number of bits, resulting in round-off errors.

A video-streaming Web site keeps count of the number of times each video has been played since it was first added to the site. The count is updated each time a video is played and is displayed next to each video to show its popularity. At one time, the count for the most popular video was about two million. Sometime later, the same video displayed a seven-digit negative number as its count, while the counts for the other videos displayed correctly. Which of the following is the most likely explanation for the error? The count for the video became larger than the maximum value allowed by the data type used to store the count. B The mathematical operations used to calculate the count caused a rounding error to occur. C The software used to update the count failed when too many videos were played simultaneously by too many users. D The software used to update the count contained a sampling error when using digital data to approximate the analog count.

The count for the video became larger than the maximum value allowed by the data type used to store the count.

Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case. A computer program performs the operation and represents the result as the value . Which of the following best explains this result? A An overflow error occurred. B The precision of the result is limited due to the constraints of using a floating-point representation. C The program attempted to execute the operation with the arguments in reverse order. D The program attempted to represent a floating-point number as an integer.

The precision of the result is limited due to the constraints of using a floating-point representation.

In a certain computer program, two positive integers are added together, resulting in an overflow error. Which of the following best explains why the error occurs? A The program attempted to perform an operation that is considered an undecidable problem. B The precision of the result is limited due to the constraints of using a floating-point representation. C The program can only use a fixed number of bits to represent integers; the computed sum is greater than the maximum representable value. D The program cannot represent integers; the integers are converted into decimal approximations, leading to rounding errors.

The program can only use a fixed number of bits to represent integers; the computed sum is greater than the maximum representable value.

Directions: For the question or incomplete statement below, two of the suggested answers are correct. For this question, you must select both correct choices to earn credit. No partial credit will be earned if only one correct choice is selected. Select the two that are best in each case. Which of the following can be represented by a single binary digit? Select two answers. A The position of the minute hand of a clock B The remainder when dividing a whole number by 2 C The value of a Boolean variable D The volume of a car radio

The remainder when dividing a whole number by 2 and The value of a Boolean variable.

A student is recording a song on her computer. When the recording is finished, she saves a copy on her computer. The student notices that the saved copy is of lower sound quality than the original recording. Which of the following could be a possible explanation for the difference in sound quality? A The song was saved using fewer bits per second than the original song. B The song was saved using more bits per second than the original song. C The song was saved using a lossless compression technique. D Some information is lost every time a file is saved from one location on a computer to another location.

The song was saved using fewer bits per second than the original song.

A binary number is to be transformed by appending three 0s to the end of the number. For example, 11101 is transformed to 11101000. Which of the following correctly describes the relationship between the transformed number and the original number? A The transformed number is 3 times the value of the original number. B The transformed number is 4 times the value of the original number. C The transformed number is 8 times the value of the original number. D The transformed number is 1,000 times the value of the original number.

The transformed number is 8 times the value of the original number.

Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case. A media librarian at a movie studio is planning to save digital video files for archival purposes. The movie studio would like to be able to access full-quality videos if they are needed for future projects. Which of the following actions is LEAST likely to support the studio's goal? A Using video file formats that conform to published standards and are supported across many different devices B Using lossy compression software to reduce the size requirements of the data being stored C Using storage media that can be expanded for additional data capacity D Using a system that incorporates redundancy to handle disk failure

Using lossy compression software to reduce the size requirements of the data being stored

ASCII is a character-encoding scheme that uses a numeric value to represent each character. For example, the uppercase letter "G" is represented by the decimal (base 10) value 71. A partial list of characters and their corresponding ASCII values are shown in the table below. ASCII characters can also be represented by hexadecimal numbers. According to ASCII character encoding, which of the following letters is represented by the hexadecimal (base 16) number 56? A A B L C V D Y

V / 86

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.

four bits are enough to store the eight directions

Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case. 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 can be encoded as by replacing all instances of with and replacing all instances of with . For which of the following strings is it NOT possible to use byte pair encoding to shorten the string's length? A "BANANA" B "LEVEL_UP" C "MEET_ME_LATER" D "NEITHER_HERE_NOR_THERE"

"LEVEL_UP"

Consider the 4-bit binary numbers 0011, 0110, and 1111. Which of the following decimal values is NOT equal to one of these binary numbers? A 3 B 6 C 9 D 15

9

Which of the following is an advantage of a lossless compression algorithm over a lossy compression algorithm? A A lossless compression algorithm can guarantee that compressed information is kept secure, while a lossy compression algorithm cannot. B A lossless compression algorithm can guarantee reconstruction of original data, while a lossy compression algorithm cannot. C A lossless compression algorithm typically allows for faster transmission speeds than does a lossy compression algorithm. D A lossless compression algorithm typically provides a greater reduction in the number of bits stored or transmitted than does a lossy compression algorithm.

A lossless compression algorithm can guarantee reconstruction of original data, while a lossy compression algorithm cannot.

The position of a runner in a race is a type of analog data. The runner's position is tracked using sensors. Which of the following best describes how the position of the runner is represented digitally? A The position of the runner is determined by calculating the time difference between the start and the end of the race and making an estimation based on the runner's average speed. B The position of the runner is measured and rounded to either 0 or 1 depending on whether the runner is closer to the starting line or closer to the finish line. C The position of the runner is predicted using a model based on performance data captured from previous races. D The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.

The position of the runner is predicted using a model based on performance data captured from previous races.

Which of the following is a true statement about data compression? A Data compression is only useful for files being transmitted over the Internet. B Regardless of the compression technique used, once a data file is compressed, it cannot be restored to its original state. C Sending a compressed version of a file ensures that the contents of the file cannot be intercepted by an unauthorized user. D There are trade-offs involved in choosing a compression technique for storing and transmitting data.

There are trade-offs involved in choosing a compression technique for storing and transmitting data.


Kaugnay na mga set ng pag-aaral

MSN 277: Ch 31 Workbook Questions

View Set

Overview of SimChart for the Medical Office

View Set

Adult Health Unit 7 Exam prep: PrepU practice questions

View Set

AP Human Geography Key Terms: Chapter 1

View Set