P1 & P2 Quiz

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

The figure below represents a network of physically linked computers labeled A through G. A line between two computers indicates that 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. A diagram of a network is shown. The letters A through G are shown, each in a circle. A is in the lower left. Bis to the right of A and connected to it by a straight line. C is to the right and up from B, and connected to it by a straight line. D is to the right and up from C, and it is connected to C by a straight line and to B by a curved line that goes around C from below. E is to the left and down from D, directly above B. E is connected to D, C, and A by straight lines. F is to the right of E, above and to the left of A. F is connected to E and A by straight lines. G is to the right and up from F, directly above A and to the left of D. G is connected to F and D by straight lines. Which of the following statements about security in the network is true? 1)Computers A and D need to communicate with at least two additional computers in the network in order to communicate with each other. 2)Computers B and C can communicate with each other without additional computers being aware of the communication.

II only

The code segment below uses the procedure IsFound (list, item), which returns true if item appears in list and returns false otherwise. The list resultList is initially empty. text... Which of the following best describes the contents of resultList after the code segment is executed?

Only elements that appear in both inputList1 and inputList2

A city government is attempting to reduce the digital divide between groups with differing access to computing and the Internet. Which of the following activities is LEAST likely to be effective in this purpose?

Putting all government forms on the city Web site

Which of the following activities poses the greatest personal cybersecurity risk?

Reserving a hotel room by e-mailing a credit card number to a hotel

An algorithm has been developed to compute the sum of all the elements in a list of integers. Which of the following programming structures must be added to the existing algorithm so that the new algorithm computes the sum of only the even integers in the list?

Selection

fault tolerant

Systems that are able to continue their operation even when problems are present.

Historically, it has been observed that computer processing speeds tend to double every two years. Which of the following best describes how technology companies can use this observation for planning purposes?

Technology companies can set research and development goals based on anticipated processing speeds.

A certain computer game is played between a human player and a computer-controlled player. Every time the computer-controlled player has a turn, the game runs slowly because the computer evaluates all potential moves and selects the best one. Which of the following best describes the possibility of improving the running speed of the game?

The game's running speed might be improved by using a process that finds approximate solutions every time the computer-controlled player has a turn.

Consider the following program, which is intended to display the number of times a number target appears in a list. A segment of code is shown. At the top is a white box that reads count left arrow 1. This is at the top left corner of a larger grey box, at the top of which it reads FOR EACH n IN list. Below this in the grey box and indented is another grey box with a white border that reads IF, then n equals target, which is encircled. Below this in the smaller grey box is a white box, in which it reads count left arrow count plus 1. Below the larger grey box at its lower left corner is a white box that reads DISPLAY, then count, which is in a rectangle. Which of the following best describes the behavior of the program?

The program correctly displays the number of times target appears in the list.

Which of the following statements is true?

There exist problems that no algorithm will ever be able to solve for all possible inputs.

Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem?

When the problem cannot be solved in a reasonable time and an approximate solution is acceptable

A retailer that sells footwear maintains a single database containing records with the following information about each item for sale in the retailer's store. *item identification number *Footwear type (sneakers, boots, sandals, etc.) *Selling price (in dollars) *Size *Color *Quantity available *Using only the database, which of the following can be determined?

Which items listed in the database are not currently in the store

The algorithm below is used to simulate the results of flipping a coin 4 times. Consider the goal of determining whether the simulation resulted in an equal number of heads and tails. Step 1: Initialize the variables heads_counter and flip_counter to 0. Step 2: A variable coin_flip is randomly assigned a value of either 0 or 1. If coin_flip has the value 0, the coin flip result is heads, so heads_counter is incremented by 1. Step 3: Increment the value of flip_counter by 1. Step 4: Repeat steps 2 and 3 until flip_counter equals 4. Following execution of the algorithm, which of the following expressions indicates that the simulation resulted in an equal number of heads and tails?

head_counter = 2

Consider the following code segment. A segment of code is shown. At the top is a white box that reads j left arrow 1. This is at the top left corner of a larger grey box, at the top of which it reads REPEAT UNTIL, the left angle bracket MISSING CONDITION right angle bracket, which is encircled. Below this in the grey box and indented is a white box that reads j left arrow j plus 2. Which of the following replacements for <MISSING CONDITION> will result in an infinite loop?

j = 6

Two lists, list1 and list2, contain the names of books found in two different collections. A librarian wants to create newList, which will contain the names of all books found in either list, in alphabetical order, with duplicate entries removed. For example, if list1 contains ["Macbeth", "Frankenstein", "Jane Eyre"] and list2 contains ["Frankenstein", "Dracula", "Macbeth", "Hamlet"], then newList will contain ["Dracula", "Frankenstein", "Hamlet", "Jane Eyre", "Macbeth"]. The following procedures are available to create newList. Which of the following code segments will correctly create newList ?

newList ← Combine (list1, list2) newList ← Sort (newList) newList ← RemoveDuplicates (newList)

The code fragment below is intended to display "odd" if the positive number num is odd. A segment of code is shown in a grey box. At the top it reads IF, then open angle bracket MISSING CONDITION close angle bracket, which is encircled. Below this and indented is a white box that reads DISPLAY, then "odd", which is in a rectangle. Which of the following can be used to replace <MISSING CONDITION> so that the code fragment will work as intended?

(num MOD 2) = 1

An author is considering publishing an e-book using a Creative Commons license. In which of the following situations would it be better for the author to use a Creative Commons license instead of traditional copyright? 1)The author wants to make the e-book available as a free download. 2)The author wants to prevent people from sharing copies of the e-book on peer-to-peer networks. 3)The author wants to allow people permission to use and modify the e-book.

1 and 3

Which of the following are true statements about digital certificates in Web browsers? 1)Digital certificates are used to verify the ownership of encrypted keys used in secured communication. 2)Digital certificates are used to verify that the connection to a Web site is fault-tolerant.

1 only.

Which of the following programs is most likely to benefit from the use of a heuristic?

A program that finds the shortest driving route between two locations on a map

phishing attack

An attack that uses deception to fraudulently acquire sensitive personal information by masquerading as an official-looking e-mail.

Which of the following best describes a Distributed Denial of Service (DDoS) attack?

An attempt to deny users access to a Web site's resources by flooding the Web site with requests from multiple systems

Distributed Denial of Service

An availability attack, to consume resources to the point of exhaustion from multiple vectors

Which of the following is LEAST likely to indicate a phishing attack?

An e-mail from your bank asks you to call the number on your card to verify a transaction

Consider the code segment below. The code consists of seven lines. Some of the lines of code are indented. Begin block Line one: IF, begin block, on Time closed up with initial capital T, end block. Line two is indented one tab: begin block, DISPLAY, begin block open quote, Hello period, close quote, end block, end block. Line three: ELSE Begin block Line four is indented one tab: IF, begin block absent end block. Line five is indented two tabs: begin block, DISPLAY, begin block open quote, Is anyone there, question mark, close quote, end block, end block. Line six is indented one tab: ELSE Line seven is indented two tabs: begin block, DISPLAY, begin block open quote, Better late than never, period, close quote, end block, end block. End block. End block. If the variables onTime and absent both have the value false, what is displayed as a result of running the code segment?

Better late than never.

A programmer completes the user manual for a video game she has developed and realizes she has reversed the roles of goats and sheep throughout the text. Consider the programmer's goal of changing all occurrences of "goats" to "sheep" and all occurrences of "sheep" to "goats." The programmer will use the fact that the word "foxes" does not appear anywhere in the original text. Which of the following algorithms can be used to accomplish the programmer's goal?

First, change all occurrences of "goats" to "foxes." Then, change all occurrences of "sheep" to "goats." Last, change all occurrences of "foxes" to "sheep."

When a cellular telephone user places a call, the carrier transmits the caller's voice as well as the voice of the person who is called. The encoded voices are the data of the call. In addition to transmitting the data, the carrier also stores metadata. The metadata of the call includes information such as the time the call is placed and the phone numbers of both participants. For which of the following goals would it be more useful to computationally analyze the metadata instead of the data? 1)To determine if a caller frequently uses a specific word 2)To estimate the number of phone calls that will be placed next Monday between 10:30 A.M. and noon. 3)To generate a list of criminal suspects when given the telephone number of a known criminal

II and III only

Central High School keeps a database of information about each student, including the numeric variables numberOfAbsences and gradePointAverage. The expression below is used to determine whether a student is eligible to receive an academic award. (numberOfAbsences ≤ 5) AND (gradePointAverage > 3.5) Which of the following pairs of values indicates that a student is eligible to receive an academic award?

numberOfAbsences = 5, gradePointAverage = 3.8

participants

the people interacting during communication


Ensembles d'études connexes

BUS 110 Chp 9: Production & Operations Management

View Set

the English colonies in Virginia

View Set

Ch 44 Assisting with Minor Surgery Study Guide

View Set

ATI Communication and Fundamental Learning system RN 3.0 465 questions

View Set

3.6. Banking and Finance - Types of Banks

View Set