apcsp test#4

Ace your homework & exams now with Quizwiz!

A programmer is writing a program that is intended to be able to process large amounts of data. Which of the following considerations is LEAST likely to affect the ability of the program to process larger data sets?

(B) How many programming statements the program contains

The figure below shows two possible network configurations for devices P through V. A line between two devices indicates a connection. Devices can communicate only through the connections shown. In configuration I, what is the minimum number of connections that must be broken or removed before device T can no longer communicate with device U?

2

The figure below represents a network of physically linked computers labeled A through G. A line between two computers indicates that the computers can communicate directly with each other. Any information sent between two computers that are not directly connected must go through at least one other computer. For example, information can be sent directly between computers A and B, but information sent between computers A and C must go through other computers.

3

The figure below represents a network of physically linked devices, labeled A through H. A line between two devices indicates a connection. Devices can communicate only through the connections shown. What is the minimum number of connections that would need to be removed from the network in order for device A to not be able to communicate with device F?

3

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?

3^32 times as many

Which of the following best describes a challenge involved in using a parallel computing solution?

A parallel computing solution may not be appropriate for an algorithm in which each step requires the output from the preceding steps.

A library of e-books contains metadata for each book. The metadata are intended to help a search feature find books that users are interested in. Which of the following is LEAST likely to be contained in the metadata of each e-book?

A/ an archive containing previous versions of the e-book

The figure below represents a network of physically linked devices labeled A through I. A line between two devices indicates that the devices can communicate directly with each other. Any information sent between two devices that are not directly connected must go through at least one other device. For example, in the network represented below, information can be sent directly between A and B, but information sent between devices A and G must go through other devices.

A/ the network is considered fault tolerant because there are redundant paths between each pair of devices.

A large data set contains information about all students majoring in computer science in colleges across the United States. The data set contains the following information about each student. The student's gender The state in which the student attends college The student's grade point average on a 4.0 scale Which of the following questions could be answered by analyzing only information in the data set?

B. How many states have a higher percentage of female computer science majors than male computer science majors attending college in that state?

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?

Compressing the file using a lossless compression algorithm before uploading it

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).

D/ The binary RGB values (11101010, 01001000, 00011101)

The cost of a customer's electricity bill is based on the number of units of electricity the customer uses. For the first 25 units of electricity, the cost is $5 per unit. For units of electricity after the first 25, the cost is $7 per unit. Which of the following code segments correctly sets the value of the variable cost to the cost, in dollars, of using numUnits units of electricity?

If (numUnits < or = 25) [cost<--numUnits * 5] Else [cost<--25 7 + (numUnits - 25) 7]

Which of the following best describes a direct benefit in using redundant routing on the Internet?

Redundancy enables messages to be transmitted with as few packets as possible.

Which of the following best explains the relationship between the Internet and the World Wide Web?

The World Wide Web is a system of linked pages, programs, and files that is accessed via a network called the Internet.

Which of the following best describes the ability of parallel computing solutions to improve efficiency?

The efficiency of a solution that can be broken down into parallel portion is still limited by a sequential portion

Consider the following code segment. x ← 25 y ← 50 z ← 75 x ← y y ← z z ← x Which of the variables have the value 50 after executing the code segment?

The first three statements assign values to the variables. The fourth statement assigns the value of y (which is 50) to x. The fifth statement assigns the value of z (which is 75) to y. The sixth statement assigns the value of x (which is 50) to z. Therefore, x and z both have the value 50.

The following figure represents a network of physically linked devices labeled P through S. A line between two devices indicates a connection. Devices can communicate only through the connections shown. The figure presents a diagram of a network of physically linked devices labeled P through S. Device P is connected to devices Q, R, and S. Device Q is connected to devices P, R, and S. Device R is connected to devices P, Q and S. Device S is connected to devices P, Q, and R. Which of the following statements best explains the ability of the network to provide fault tolerance?

The network is considered fault-tolerant because there are redundant paths between each pair of devices.

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?

The program cannot represent integers; the integers are converted into decimal approximations, leading to rounding errors.

A student is writing a program to model different real-world events using simulations. Which of the following simulations will generate a result that would best be stored using a Boolean variable?

a simulation of flipping a fair coin

The variable initials is to be assigned a string consisting of the first letter of the string firstName followed by the first letter of the string lastName. Which of the following assigns the correct string to initials ?

a/ initials <-- concat(prefix(firstName, 1), prefix(lastName,1))

Which of the following statements about the Internet is true?

a/ the internet requires communications to use encryption protocols

A database of information about shows at a concert venue contains the following information. Name of artist performing at the show Date of show Total dollar amount of all tickets sold Which of the following additional pieces of information would be most useful in determining the artist with the greatest attendance during a particular month?

average ticket price

The variable age is to be used to represent a person's age, in years. Which of the following is the most appropriate data type for age ?

b/ number

A teacher is writing a code segment that will use variables to represent a student's name and whether or not the student is currently absent. Which of the following variables are most appropriate for the code segment?

c - a string variable named studentName and a Boolean variable named isAbsent

The table below shows the time a computer system takes to complete a specified task on the customer data of different-sized companies. Based on the information in the table, which of the following tasks is likely to take the longest amount of time when scaled up for a very large company of approximately 100,000 customers?

sorting data

Consider a game in which a player flips a fair coin three times. If all three coin flips have the same result (either all heads or all tails) the player wins. Otherwise, the player loses. Which of the following code segments best simulates the behavior of the game?

spi 1/6 spi equal 1 yellow spi equal 2 blue red


Related study sets

What is Science?/ Scientific Knowledge

View Set

BADM 710 Final Exam (Connect Quizzes)

View Set

Add a Little Spice (& Herbs) to your Life Packet

View Set

Chapter 2 - Money & the Monetary System: Practice Questions

View Set

MOLECULAR SHAPES: NO LONE PAIRS ON CENTRAL ATOM CK12

View Set