2nd Half of 2021 Practice Exam MCQ

¡Supera tus tareas y exámenes ahora con Quizwiz!

In the following code segment, assume that the variable n has been initialized with an integer value. Which of the following is NOT a possible value displayed by the program?

"carrot"

The following table shows the value of expression based on the values of input1 and input2. Which of the following expressions are equivalent to the value of expression as shown in the table?

(NOT input1) OR (NOT input2) NOT (input1 AND input2)

A large spreadsheet contains the following information about local restaurants. A sample portion of the spreadsheet is shown below. In column B, the price range represents the typical cost of a meal, where "lo" indicates under $10, "med" indicates $11 to $30, and "hi" indicates over $30. In column D, the average customer rating is set to -1.0 for restaurants that have no customer ratings. A student wants to count the number of restaurants in the spreadsheet whose price range is $30 or less and whose average customer rating is at least 4.0. For a given row in the spreadsheet, suppose prcRange contains the price range as a string and avgRating contains the average customer rating as a decimal number. Which of the following expressions will evaluate to true if the restaurant should be counted and evaluates to false otherwise?

(avgRating ≥ 4.0) AND ((prcRange = "lo") OR (prcRange = "med"))

Consider the following code segment. intergerList <---- later What value is displayed as a result of executing the code segment?

3

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?

7

A sorted list of numbers contains 128 elements. Which of the following is closest to the maximum number of list elements that can be examined when performing a binary search for a value in the list?

8

Which of the following best exemplifies the use of keylogging to gain unauthorized access to a computer system?

A user unintentionally installs a program on their computer that records all user input and forwards it to another computer. A few weeks later, someone else is able to access the user's computer using the recorded data.

Which of the following is an example of an attack using a rogue access point?

An unauthorized individual gains the ability to view network traffic by connecting to a network router that uses weak or no security measures.

Which of the following research proposals is most likely to be successful as a citizen science project?

Collecting pictures of birds from around the world that can then be analyzed to determine how location affects bird size

A group of students take hundreds of digital photos for a science project about weather patterns. Each photo file contains data representing the level of red, green, and blue for each pixel in the photo. The file also contains metadata that describes the date, time, and geographic location where the photo was taken. For which of the following goals would analyzing the metadata be more appropriate than analyzing the data? Select two answers.

Determining the chronological order of the photos Determining whether two photos were taken at the same location on different days

A large spreadsheet contains the following information about local restaurants. A sample portion of the spreadsheet is shown below. In column B, the price range represents the typical cost of a meal, where "lo" indicates under $10, "med" indicates $11 to $30, and "hi" indicates over $30. In column D, the average customer rating is set to -1.0 for restaurants that have no customer ratings. A student is developing an algorithm to determine which of the restaurants that accept credit cards has the greatest average customer rating. Restaurants that have not yet received any customer ratings and restaurants that do not accept credit card are to be ignored. Once the algorithm is complete, the desired restaurant will appear in the first row of the spreadsheet. If there are multiple entries that fit the desired criteria, it does not matter which of them appears in the first row. The student has the following actions available but is not sure of the order in which they should be executed. Assume that applying either of the filters will not change the relative order of the rows remaining in the spreadsheet. Which of the following sequences of steps can be used to identify the desired restaurant? I. Filter by number of ratings, then filter by payment type, then sort by rating II. Filter by number of ratings, then sort by rating, then filter by payment type III. Sort by rating, then filter by number of ratings, then filter by payment type

I, II, and III

The following spinner is used in a game. The region labeled "blue" represents 1/4 of the spinner. The regions labeled "orange" and "purple" are equal in size. Which of the following code segments can be used to simulate the behavior of the spinner? Select two answers.

If random 1,4 = 1 Display "blue Else if random 1,2 = 1 display "orange" else display "purple" spin <== random 1,4 if spin = 1 display "blue" else spin <--- random 1,2 if spin =2 display "orange" else display "purple"

RunRoutr is a fitness tracking application for smartphones that creates suggested running routes so that users can run with each other. Upon downloading the application, each user creates a username, a personal profile, and a contact list of friends who also use the application. The application uses the smartphone's GPS unit to track a user's location, running speed, and distance traveled. Users can use the application to review information and statistics about their previous runs. At the beginning of a run, users indicate the distance they want to run from their current location, and the application suggests a running route. Once a user accepts a suggested route, the application shares the suggested route with other compatible users in the area so that they can run together. Users are considered compatible if they are on each other's contact lists or if they typically run at similar speeds. A basic RunRoutr account is free, but it displays advertisements that are targeted to individual users based on data collected by the application. For example, if a user's running route begins or ends near a particular store, the application may display an advertisement for that store. Users have the ability to pay a monthly fee for a premium account, which removes advertisements from the application. Businesses have the ability to target advertisements to different groups of people who use RunRoutr. Which of the following groups is LEAST likely to receive targeted advertisements?

Individuals who sign up for a premium account

In the following procedure, the parameter age represents a person's age. The procedure is intended to return the name of the age group associated with age. People who are under 18 are considered minors, people who are 65 and older are considered senior citizens, and all other people are considered adults. The procedure does not work as intended. Line 1: PROCEDURE ageGroup(age) Line 2: { Line 3: result ←← "adult" Line 4: IF(age ≥ 65) Line 5: { Line 6: result ←← "senior citizen" Line 7: } Line 8: RETURN(result) Line 9: Line 10: result ←← "adult" Line 11: IF(age < 18) Line 12: { Line 13: result ←← "minor" Line 14: } Line 15: RETURN(result) Line 16: } Removing which two lines of code will cause the procedure to work as intended? Select two answers.

Line 8 and Line 10

A state government is attempting to reduce the digital divide. Which of the following activities has the greatest potential to contribute to the digital divide rather than reducing it?

Requiring applicants for government jobs to apply using an online platform

A certain computer has two identical processors that are able to run in parallel. The following table indicates the amount of time it takes to execute each of four processes on a single processor. Assume that none of the processes is dependent on any of the other processes. Which of the following parallel computing solutions would minimize the amount of time it takes to execute all four processes?

Running processes P and Q on one processor and processes R and S on the other processor

Each student at a school has a unique student ID number. A teacher has the following spreadsheets available. Spreadsheet I contains information on all students at the school. For each entry in this spreadsheet, the student name, the student ID, and the student's grade point average are included. Spreadsheet II contains information on only students who play at least one sport. For each entry in this spreadsheet, the student ID and the names of the sports the student plays are included. Spreadsheet III contains information on only students whose grade point average is greater than 3.5. For each entry in this spreadsheet, the student name and the student ID are included. Spreadsheet IV contains information on only students who play more than one sport. For each entry in this spreadsheet, the student name and the student ID are included. The teacher wants to determine whether students who play a sport are more or less likely to have higher grade point averages than students who do not play any sports. Which of the following pairs of spreadsheets can be combined and analyzed to determine the desired information?

Spreadsheets I and II

A list of numbers has n elements, indexed from 1 to n. The following algorithm is intended to display true if the value target appears in the list more than once and to display false otherwise. The algorithm uses the variables position and count. Steps 4 and 5 are missing. Step 1:Set count to 0 and position to 1.Step 2:If the value of the element at index position is equal to target, increase the value of count by 1.Step 3:Increase the value of position by 1.Step 4:(missing step)Step 5:(missing step) Which of the following could be used to replace steps 4 and 5 so that the algorithm works as intended?

Step 4 Repeat steps 2 and 3 until the value of position is greater than n. Step 5 If count is greater than or equal to 2, display true. Otherwise, display false.

Which of the following best explains how symmetric encryption algorithms are typically used?

Symmetric encryption uses a single key that should be kept secret. The same key is used for both encryption and decryption of data.

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?

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

An online gaming company is introducing several new initiatives to encourage respectful communication between players of online games. Which of the following best describes a solution that uses crowdsourcing?

The company allows individual players to endorse fellow players based on courteous interactions. Once a player receives enough endorsements, the player is given free rewards that can be used during gameplay.

Adrianna uses RunRoutr to suggest a running route. All compatible users near Adrianna receive a notification that shows her running route. Which of the following data is not obtained using data collected from Adrianna's smartphone but necessary for RunRoutr to share Adrianna's running route?

The current locations of other RunRoutr users

Which of the following data must be collected from a user's smartphone in order for RunRoutr to suggest a running route?

The user's geographic position

Which of the following best explains the ability to solve problems algorithmically?

There exist some problems that cannot be solved algorithmically using any computer.

each user creates a username, a personal profile, and a contact list of friends who also use the application. The application uses the smartphone's GPS unit to track a user's location, running speed, and distance traveled. Users can use the application to review information and statistics about their previous runs. At the beginning of a run, users indicate the distance they want to run from their current location, and the application suggests a running route. Once a user accepts a suggested route, the application shares the suggested route with other compatible users in the area so that they can run together. Users are considered compatible if they are on each other's contact lists or if they typically run at similar speeds. A basic RunRoutr account is free, but it displays advertisements that are targeted to individual users based on data collected by the application. For example, if a user's running route begins or ends near a particular store, the application may display an advertisement for that store. Users have the ability to pay a monthly fee for a premium account, which removes advertisements from the application. Which of the following is most likely to be a data privacy concern for RunRoutr users?

Users of the application may have the ability to determine information about the locations of users that are not on their contact lists.

Which of the following is most likely to be a benefit to users of the application?

Users of the application may see health benefits as a result of the application encouraging them to exercise with each other.

Delivery trucks enter and leave a depot through a controlled gate. At the depot, each truck is loaded with packages, which will then be delivered to one or more customers. As each truck enters and leaves the depot, the following information is recorded and uploaded to a database. The truck's identification number The truck's weight The date and time the truck passes through the gate Whether the truck is entering or leaving the depot Using only the information in the database, which of the following questions CANNOT be answered?

What is the average number of customer deliveries made by each truck on a particular day?

What is the average number of customer deliveries made by each truck on a particular day?

When the solution to the problem requires real-world data inputs that are continually measured at regular intervals.

The following code segment is intended to remove all duplicate elements in the list myList. The procedure does not work as intended. j ←← LENGTH(myList) REPEAT UNTIL(j = 1) { IF(myList[j] = myList[j - 1]) { REMOVE(myList, j) } j ←← j - 1 } For which of the following contents of myList will the procedure NOT produce the intended results? Select two answers.

[10, 10, 20, 20, 10, 10] [30, 50, 40, 10, 20, 40]

In a certain video game, players are awarded bonus points at the end of a level based on the value of the integer variable timer. The bonus points are awarded as follows. If timer is less than 30, then 500 bonus points are awarded. If timer is between 30 and 60 inclusive, then 1000 bonus points are awarded. If timer is greater than 60, then 1500 bonus points are awarded. Which of the following code segments assigns the correct number of bonus points to bonus for all possible values of timer ? Select two answers.

bonus <--- 500 if timer greater than equal to 30 bonus <---- bonus + 500 if timer greater than 60 bonus <--- bonus + 500 if timer greather than 60 bonus <--- 1500 if timer greater than equal to 30 and timer less than equal to 60 bonus <--- 1000 if timer less than 30 bonus <--- 500

The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is initially facing right. Consider the following procedure. Which of the following code segments will move the robot to the gray square along the path indicated by the arrows?

botStepper 2 MOVE_FORWARD botStepper 3

Assume that the Boolean variable hot is assigned the value true and the Boolean variable humid is assigned the value false. Which of the following will display the value true ? Select two answers.

if not humid display (hot or humid) if hot or humid display hot

The following procedures are available for string manipulation. A programmer wants to create a new string by removing the character in position n of the string oldStr. For example, if oldStr is "best" and n is 3, then the new string should be "bet". Assume that 1 < n < len(oldStr). Which of the following code segments can be used to create the desired new string and store it in newStr ? Select two answers.

left ←substring(oldStr, 1, n - 1) right ←substring(oldStr, n + 1, len(oldStr)) newStr ← concat(left, right) newStr ←substring(oldStr, 1, n - 1) newStr ←concat(newStr, substring(oldStr, n + 1, len(oldStr)))

A code segment is intended to transform the list utensils so that the last element of the list is moved to the beginning of the list. For example, if utensils initially contains ["fork", "spoon", "tongs", "spatula", "whisk"], it should contain ["whisk", "fork", "spoon", "tongs", "spatula"] after executing the code segment. Which of the following code segments transforms the list as intended?

len ←← LENGTH(utensils) temp ←← utensils[len] REMOVE(utensils, len) INSERT(utensils, 1, temp)


Conjuntos de estudio relacionados

MIS 6382 - Object Oriented Programming in Python

View Set

Free code ...- Just look up http://html.m0.to/ and paste.

View Set

Module 2 Quiz - Cardiovascular Endurance

View Set

Auditing 05: Substantive Tests of Cash

View Set

accounting finalGAAP refers to guidelines for accounting information in the United States. The acronym GAAP in this statement refers to​ ________.

View Set

MKT 300 Exam 2, Exam 2- Chapter 7, MKTG 3832 Exam 2 Williams, Chapter 7: Business Marketing, Test 2 ch. 7-12

View Set