csp midterm

Ace your homework & exams now with Quizwiz!

DineOutHelper is a mobile application that people can use to select a restaurant for a group meal. Each user creates a profile with a unique username and a list of food allergies or dietary restrictions. Each user can then build a contact list of other users of the app. A user who is organizing a meal with a group selects all the members of the group from the user's contact list. The application then recommends one or more nearby restaurants based on whether the restaurant can accommodate all of the group members' allergies and dietary restrictions. Suppose that Alejandra is using DineOutHelper to organize a meal with Brandon and Cynthia. Which of the following data are needed for DineOutHelper to recommend a restaurant for the group? Each group member's list of food allergies or dietary restrictions Alejandra's geographic location The usernames of the people on Brandon and Cynthia's contact lists A I and II only B I and III only C II and III only D I, II, and III

I and II 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

n a certain game, the integer variable bonus is assigned a value based on the value of the integer variable score. If score is greater than 100, bonus is assigned a value that is 10 times score. If score is between 50 and 100 inclusive, bonus is assigned the value of score. If score is less than 50, bonus is assigned a value of 0. Which of the following code segments assigns bonus correctly for all possible integer values of score ? Select two answers. A IF(score > 100) { bonus ←← score * 10 } ELSE { IF(score ≥ 50) { bonus ←← score } ELSE { bonus ←← 0 } } B IF(score ≥ 50) { IF(score > 100) { bonus ←← score * 10 } ELSE { bonus ←← 0 } } ELSE { bonus ←← score } C IF(score < 50) { bonus ←← 0 } ELSE { IF(score ≥ 50) { bonus ←← score } ELSE { bonus ←← score * 10 } } D IF(score < 50) { bonus ←← 0 } ELSE { IF(score > 100) { bonus ←← score * 10 } ELSE { bonus ←← score } }

IF(score > 100) { bonus ←← score * 10 } ELSE { IF(score ≥ 50) { bonus ←← score } ELSE { bonus ←← 0 } }

The figure below represents a network of physically linked devices, labeled A through F. A line between two devices indicates a connection. Devices can communicate only through the connections shown. Which of the following statements are true about the ability for devices A and C to communicate? Select two answers. A If devices B and D were to fail, then information sent from device A could not reach device C. B If devices B and F were to fail, then information sent from device A could not reach device C. C If devices D and F were to fail, then information sent from device A could not reach device C. D If devices E and F were to fail, then information sent from device A could not reach device C.

If devices B and D were to fail, then information sent from device A could not reach device C.

In the following procedure, assume that the parameter x is an integer. Which of the following best describes the behavior of the procedure? A It displays nothing if x is negative and displays true otherwise. B It displays nothing if x is negative and displays false otherwise. C It displays true if x is negative and displays nothing otherwise. D It displays true if x is negative and displays false otherwise.

It displays true if x is negative and displays nothing otherwise.

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.

Which of the following actions is most likely to be effective in reducing the digital divide at a local level? A Creating an application that offers coupons and discounts for local businesses B Offering a discount to utility customers who pay their bills online instead of by mail C Providing free community access to computers at schools, libraries, and community centers D Requiring applicants for local government jobs to complete an online application

Providing free community access to computers at schools, libraries, and community centers

Which of the following is LEAST likely to be a contributing factor to the digital divide? A Some individuals and groups are economically disadvantaged and cannot afford computing devices or Internet connectivity. B Some individuals and groups do not have the necessary experience or education to use computing devices or the Internet effectively. C Some parents prefer to limit the amount of time their children spend using computing devices or the Internet. D Some residents in remote regions of the world do not have access to the infrastructure necessary to support reliable Internet connectivity.

Some parents prefer to limit the amount of time their children spend using computing devices or the Internet.

Which of the following best explains how the Internet is a fault-tolerant system? A The Internet is fault-tolerant because cybercriminals can conceal their actions, allowing them the ability to carry out faulty actions without leaving a trace. B The Internet is fault-tolerant because there are usually multiple paths between devices, allowing messages to sometimes be sent even when parts of the network fail. C The Internet is fault-tolerant because users can transmit messages using a variety of different protocols, allowing them to use devices from any manufacturer. D The Internet is fault-tolerant because users usually understand and accept the fact that servers sometimes fail, allowing network engineers to repair faulty devices as quickly as possible.

The Internet is fault-tolerant because there are usually multiple paths between devices, allowing messages to sometimes be sent even when parts of the network fail.

Which of the following best describes the relationship between the World Wide Web and the Internet? A The World Wide Web is a protocol that is accessed using a data stream called the Internet. B The World Wide Web is a system of linked pages, programs, and files that is accessed using a data stream called the Internet. C The World Wide Web is a system of linked pages, programs, and files that is accessed via a network called the Internet. D The World Wide Web is a Web site that is accessed using a protocol called the Internet.

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

A student is creating an application that allows customers to order food for delivery from a local restaurant. Which of the following is LEAST likely to be an input provided by a customer using the application? A The address where the order should be delivered B The cost of a food item currently available for order C The credit card or payment information for the purchaser D The name of a food item to be included in the delivery

The cost of a food item currently available for order

Which of the following best explains how messages are typically transmitted over the Internet? A The message is broken into packets that are transmitted in a specified order. Each packet must be received in the order it was sent for the message to be correctly reassembled by the recipient's device. B The message is broken into packets. The packets can be received in any order and still be reassembled by the recipient's device. C The message is broken into two packets. One packet contains the data to be transmitted and the other packet contains metadata for routing the data to the recipient's device. D The message is transmitted as a single file and received in whole by the recipient's device.

The message is broken into packets. The packets can be received in any order and still be reassembled by the recipient's device.

he 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. Which of the following statements best explains the ability of the network to provide fault tolerance? A The network is considered fault-tolerant because there are redundant paths between each pair of devices. B The network is considered fault-tolerant because it guarantees that no individual component will fail. C The network is not considered fault-tolerant because it relies on physical connections. D The network is not considered fault-tolerant because it provides more paths than are needed.

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

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 sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.

The variable isOpen is to be used to indicate whether or not a store is currently open. Which of the following is the most appropriate data type for isOpen ? A Boolean B number C string D list

boolean

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 ? A Boolean B number C string D list

number

n the following expression, the variable truckWeight has the value 70000 and the variable weightLimit has the value 80000. truckWeight < weightLimit What value does the expression evaluate to? A 70000 B 80000 C true D false

true

The following code segment is used to determine whether a customer is eligible for a discount on a movie ticket. val1 ←← (NOT (category = "new")) OR (age ≥ 65) val2 ←← (category = "new") AND (age < 12) If category is "new" and age is 20, what are the values of val1 and val2 as a result of executing the code segment? A val1 = true, val2 = true B val1 = true, val2 = false C val1 = false, val2 = true D val1 = false, val2 = false

val1 = false, val2 = false

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? A x only B y only C x and z only D x, y, and z

x and z only

To attend a particular camp, a student must be either at least 13 years old or in grade 9 or higher, but must not yet be 18 years old. Let age represent a student's age and let grade represent the student's grade level. Which of the following expressions evaluates to true if the student is eligible to attend the camp and evaluates to false otherwise? A ((age ≥ 13) OR (grade ≥ 9)) AND (age ≤ 18) B ((age ≥ 13) OR (grade ≥ 9)) AND (age < 18) C ((age ≥ 13) OR (grade ≥ 9)) OR (age ≤ 18) D ((age ≥ 13) OR (grade ≥ 9)) OR (age < 18)

((age ≥ 13) OR (grade ≥ 9)) AND (age < 18)

Let n be an integer value. Which of the following expressions evaluates to true if and only if n is a two-digit integer (i.e., in the range from 10 to 99, inclusive)? A n = (n MOD 100) B (n ≥ 10) AND (n < 100) C (n < 10) AND (n ≥ 100) D (n > 10) AND (n < 99)

(n ≥ 10) AND (n < 100)

To qualify for a particular scholarship, a student must have an overall grade point average of 3.0 or above and must have a science grade point average of over 3.2. Let overallGPA represent a student's overall grade point average and let scienceGPA represent the student's science grade point average. Which of the following expressions evaluates to true if the student is eligible for the scholarship and evaluates to false otherwise? A (overallGPA > 3.0) AND (scienceGPA > 3.2) B (overallGPA > 3.0) AND (scienceGPA ≥ 3.2) C (overallGPA ≥ 3.0) AND (scienceGPA > 3.2) D (overallGPA ≥ 3.0) AND (scienceGPA ≥ 3.2)

(overallGPA ≥ 3.0) AND (scienceGPA > 3.2)

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.

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.

Which of the following best explains how fault tolerance in a network is achieved? A By providing high-bandwidth connections between devices, enabling data packets to be transmitted as quickly as possible B By providing multiple paths between devices, enabling routing to occur even in the presence of a failed component C By providing open network protocols, ensuring that all devices on the network are interacting in a standard way D By providing software to monitor all network traffic, ensuring that data packets are sent and received in the proper order

By providing multiple paths between devices, enabling routing to occur even in the presence of a failed component

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 lossless compression algorithm before uploading it

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

Which of the following actions is most likely to help reduce the digital divide? Which of the following actions is most likely to help reduce the digital divide? A Adding a requirement that all users of a popular social media site link their accounts with a phone number. B Deploying satellites and other infrastructure to provide inexpensive Internet access to remote areas of Earth C Digitizing millions of books from university libraries, making their full text available online D Offering improved Internet connections to Internet users who are willing to pay a premium fee for more bandwidth

Digitizing millions of books from university libraries, making their full text available online

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.


Related study sets

Interpret Linux File System Permissions

View Set

AIR 1002 Department of the Air Force

View Set

Types of Life Policies Ch2 Texas Life Insurance Exam

View Set

Government Chapter 14 Foreign Policy

View Set

Chapter 21: Bonus Chapter A: Working within the Legal Environment

View Set

Best 100 closing lines from books (from https://www.stylist.co.uk/books/the-best-100-closing-lines-from-books/123681, on 2/18/2019)

View Set