UCS APCSP Final Exam Review

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Consider the code segment below. Line 1: IF (a = 0) Line 2: { Line 3: b=a+1 Line 4: } Line 5: ELSE Line 6: { Line 7: b= a+2 Line 8: } Which of the following changes will NOT affect the results when the code segment is executed? (A) Changing line 3 to b=10 (B) Changing line 3 to a=b+10 (C) Changing line 7 to b=30 (D) Changing line 7 to a=b+20

(A) Changing line 3 to b=10

A user enters a Web address in a browser, and a request for a file is sent to a Web server. Which of the following best describes how the file is sent to the user? (A) The file is broken into packets for transmission. The packets must be reassembled upon receipt. (B) The file is broken into packets for transmission. The user's browser must request each packet in order until all packets are received. (C) The server attempts to connect directly to the user's computer. If the connection is successful, the entire file is sent. If the connection is unsuccessful, an error message is sent to the user. (D) The server repeatedly attempts to connect directly to the user's computer until a connection is made. Once the connection is made, the entire file is sent.

(A) The file is broken into packets for transmission. The packets must be reassembled upon receipt.

Consider the following program, which is intended to display the number of times a number target appears in a list. Count=0 For each n IN list if n=target count=count+1 Display Count Which of the following best describes the behavior of the program? (A) The program correctly displays the number of times target appears in the list. (B) The program does not workas intended when target does not appear in the list. (C) The program does not workas intended when target appears in the list more than once. (D) The program does not workas intended when target appears as the last element of the list.

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

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.

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.14 II. To represent the current score in a game III. 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

(B) I and III only

Which of the following statements about security in the network is true? I. Computers A and D need to communicate with at least two additional computers in the network in order to communicate with each other. II. Computers B and C can communicate with each other without additional computers being aware of the communication. (A) I only (B) II only (C) I and II (D) Neither I nor II

(B) II only

A cable television company stores information about movie purchases made by subscribers. Each day, the following information is summarized and stored in a publicly available database. • The day and date each movie was purchased • The title of each movie purchased • The cities where subscribers purchased each movie • The number of times each movie was purchased by subscribers in a given city A sample portion of the database is shown below. The database is sorted by date and movie title. Day and Date Movie Title City Number of Times Purchased Sat 01 / 05 / 2014 Movie A Houston, Texas 1 Sat 01 / 05 / 2014 Movie A Detroit, Michigan 2 Sat 01 / 05 / 2014 Movie B Houston, Texas 1 Sat 01 / 05 / 2014 Movie C Anchorage, Alaska 1 Sun 01 / 06 / 2014 Movie A Wichita, Kansas 3 Which of the following CANNOT be determined using only the information in the database? (A) The date when a certain movie was purchased the greatest number of times (B) The number of movies purchased by an individual subscriber for a particular month (C) The total number of cities in which a certain movie was purchased (D) The total number of movies purchased in a certain city during a particular month

(B) The number of movies purchased by an individual subscriber for a particular month

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? (A) numberOfAbsences = 3, gradePointAverage = 3.5 (B) numberOfAbsences = 5, gradePointAverage = 3.8 (C) numberOfAbsences = 6, gradePointAverage = 3.4 (D) numberOfAbsences = 6, gradePointAverage = 3.6

(B) numberOfAbsences = 5, gradePointAverage = 3.8

What is the minimum number of connections that must be broken or removed in the network before computer E can no longer communicate with computer F? (A) 1 (B) 2 (C) 3 (D) 4

(C) 3

Computers are often used to search through large sets of data to find useful patterns in the data. Which of the following tasks is NOT an example where searching for patterns is needed to produce useful information? (A) A credit card company analyzing credit card purchases to identify potential fraudulent charges (B) A grocery store analyzing customers' past purchases to suggest new products the customer may be interested in (C) A high school analyzing student grades to identify the students with the top ten highest grade point averages (D) An online retailer analyzing customers' viewing habits to suggest other products based on the purchasing history of other customers

(C) A high school analyzing student grades to identify the students with the top ten highest grade point averages

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

(C) J (its 74)

The code fragment below is intended to display "odd" if the positive number num is odd. If <Missing condition> display "odd" Which of the following can be used to replace <MISSING CONDITION> so that the code fragment will work as intended? (A) (num MOD 1) = 0 (B) (num MOD 1) = 1 (C) (num MOD 2) = 0 (D) (num MOD 2) = 1

(D) (num MOD 2) = 1 (remember that Mod is divide and the answer is the remainder)

A new bank plans to make customer convenience a prioritybyminimizing the amount of time a customer waits in line. The bank is considering two options: a single line where the customer at the front waits for the next available teller, or separate lines for each teller. The bank decides to use a computer simulation of these two options to determine the average wait time for customers. Which of the following is NOT true about the bank's plan? (A) The bank can incorporate other factors, such as the number of tellers, in the simulation. (B) The bank can use the simulation to investigate these two options without causing inconvenience for customers. (C) The bank mayconsider new alternatives based on the simulation results. (D) The simulation will not produce usable results because actual customer data are not available.

(D) The simulation will not produce usable results because actual customer data are not available.

Which of the following boolean expressions are equivalent to the expression num ≥ 15

(num > 15) OR (num = 15) NOT (num < 15)

A local government uses Short Message Service(SMS) text messages to alert local residents when roads are closed. What are true statements regarding the benefits of using SMS text messages for the purpose described? Select two answers

-SMS text messages are likely to reach recipients quickly. -SMS text messages can be sent to multiple recipients.

The procedure Draw (length, direction) is used to draw a line segment length units long in a given direction (left, right, up, or down), starting at the current cursor position. The cursor is then repositioned at the end of the line segment that was drawn. Consider the following program, where the cursor starts in the upper left corner of a grid of dots. The dots are spaced one unit apart. Draw (1, right) Draw (2, down) Draw (1, left) Draw (1, right) Draw (1, up) Draw (1, left) Which of the following represents the figure that is drawn by the program?

. . . . . . . . .

Consider the following code segment, which uses the variables r, s, and t. r=1 s=2 t=3 r=s s=t Display (r) Display (s) What is displayed as a result of running the code segment? What is displayed as a result of running the code segment?

2 3

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?

2 times as many items can be uniquely identified

In the program below, y is a positive integer (e.g., 1, 2, 3...) What is the value of result after running the program?

3y

Which of the following has the greatest potential for compromising a user's personal privacy?

A group of cookies stored by the user's Web browser

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

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initiallyin the bottom-left square of the grid and facing toward the top of the grid. Code for the procedure Mystery is shown below. Assume that the parameter p has been assigned a positive integer value (e.g., 1, 2, 3, ...). Which of the following shows a possible result of calling the procedure? a) b) c) d)

A) (its facing left)

A flowchart is a way to visually represent an algorithm. The flowchart below uses the following building blocks. count=1 Repeat until count is equal to or greater than 5 { if count<5 then count=count+1} Display (count) What is displayed as a result of executing the algorithm in the flowchart? (A) 5 (B) 15 (C) 1234 (D) 12345

A) 5

3. Which of the following best explains what happens when a new device is connected to the Internet?

An Internet Protocol (IP) address is assigned to the device.

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

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

A computer program uses 3 bits to represent integers. When the program adds the decimal (base 10) numbers 5 and 3, the result is 0. Which of the following is the best explanation for the result?

An overflow error occurred

A code segment will be used to swap the values of the variables a and b using the temporary variable temp. Which of the following code segments correctly swaps the values of a and b ?

B

Researchers have developed a simulation of packets traveling between server computers and client computers in a network. Of the following, which two outcomes are most likely to be results of the simulation?

Better understanding of the effect of temporarily unavailable network connections Better understanding of the impact of increased connection speeds for frequently visited servers

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?

Creating the negative of an image by creating a new RBG 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 numbers. Binary 1100 Decimal 11 Hexadecimal D Which of the following lists the numbers in order from least to greatest?

Decimal 11, Binary 1100, Hexadecimal D

A programmer is deciding between using a linear or binary search to find a target value in a sorted list. Which of the following is true?

Generally, the advantage of using a binary search over a linear search increases as the size of the list increases

Two grids are shown below. Each grid contains a robot represented as a triangle. Both robots are initially facing left. Each robot can move into a white or gray square, but cannot move into a black region

Grid I only

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?

How many programming statements the program contains

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?

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

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 a traditional copyright? I. The author wants to make the e-book available as a free download. II. The author wants to prevent people from sharing copies of the e-book on peer-to-peer networks. III. The author wants to allow people permission to use and modify the e-book.

I and III

A car manufacturer uses simulation software during the design process for a new car. Which of the following are reasons to use simulation software in this context? I Using simulation software can save the company money by helping to compare designs early in the process, before prototype cars are built. II Using simulation software can help to identify safety issues by providing data about how different mechanical components will interact in a wide variety of situations. III The manufacturer can present simulation software to customers to demonstrate different design possibilities.

I, II, and III

Which of the following statements are true about using a high-level programming language instead of a lower-level language? I. Programs written in a high-level language are generally easier for people to read than programs written in a low-level language. II. A high-level language provides programmers with more abstractions than a low-level language. III. Programs written in a high-level language are generally easier to debug than programs written in a low-level language.

I, II, and III

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? I. To determine if a caller frequently uses a specific word II. To estimate the number of phone calls that will be placed next Monday between 10:30 A.M. and noon. III. To generate a list of criminal suspects when given the telephone number of a known criminal

II and III only

Many Web browsers allow users to open anonymous windows. During a browsing session in an anonymous window, the browser does not record a browsing history or a list of downloaded files. When the anonymous window is exited, cookies created during the session are deleted. Which of the following statements about browsing sessions in an anonymous window is true?

Items placed in a Web store's shopping cart for future purchase during the anonymous browsing session will not be saved on the user's computer

In the program below, the initial value of x is 5 and the initial value of y is 10. IF (x<0) Display "Foxtrot" else if (x>y) display "Hotel" else if (y>0) display "November" else display "Yankee" What is displayed as a result of running the program?

November

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. FOR EACH item IN inputList1 { IF (IsFound (inputList2, item) { APPEND (resultList, item) } } 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

Which of the following is a true statement about program documentation?

Program documentation is useful during initial program development and also when modifications are made to existing programs

Which of the following is considered an unethical use of computer resources?

Purchasing a single-user copy of photo editing software and installing it on all the computers in a computer lab

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

In a certain district, 20 percent of the voters are expected to vote for Candidate A in an election. The computer program below is intended to simulate the result of the election with n voters, and display the number of votes received by Candidate A Which of the following can be used to replace <MISSING CONDITION> in line 4 so that the program works as intended?

RANDOM (1,5) = 1 RANDOM (1,10) ≤ 2

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

Which of the following is a true statement about cloud computing?

Storing data using cloud computing can help ensure that data are not lost if a user's computer stops functioning

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

Both online newspapers and social media sites are used to distribute information on the Internet. Which of the following best describes an advantage that online newspapers have over social media sites?

The ability to provide credibility to the information distributed

Which of the following is a characteristic of the fault-tolerant nature of routing on the Internet?

The ability to provide data transmission even when some connections have failed

Two computers are built by different manufacturers. One is running a Web server and the other is running a Web browser. Which of the following best describes the ability of the two computers to communicate with each other across the Internet?

The computers can communicate directly because Internet communication uses standard protocols

A school library allows students to borrow laptops. A computer program is used to count the number of times a particular laptop has been borrowed from the library (borrows) and the number of times the same laptop has been returned to the library (returns). Which of the following indicate that a particular laptop is not currently borrowed?

The difference between borrows and returns is zero The sum of borrows and returns is a positive even number

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

The diagram below shows a circuit composed of two logic gates labeled OR and AND. Each gate takes two inputs and produces a single output the inputs A and C are both true, which of the following best describes the output of the AND gate?

The output will be true no matter what the value of input B is

In the procedure Mystery below, the parameter number is a positive integer. Procedure Mystery (number) { REPEAT UNTIL (number <= 0) { number <- number -2 } IF (number = 0) { RETURN (true) } ELSE { RETURN (false) } } Which of the following best describes the result of running the procedure Mystery?

The procedure returns true when the initial value of number is even, and it otherwise returns false

A program is expressed in a programming language. Which of the following is true of the program?

The program can also be expressed as binary code, but will be more easily understood by humans when expressed in a higher-level programming language

Which of the following are benefits of using well-named variables in a computer program?

The program will be easier for people to read The program will be easier to modify in the future.

Which of the following can be represented by a single binary digit?

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

Which of the following statements is true?

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

An Internet service provider (ISP) is considering an update to its servers that would save copies of the Web pages most frequently visited by each user. Which of the following is LEAST likely to occur as a result of the update?

Web sites that are not visited frequently might no longer be accessible to users

A search engine has a trend-tracking feature that provides information on how popular a search term is. The data can be filtered by geographic region, date, and category. Categories include arts and entertainment, computers and electronics, games, news, people and society, shopping, sports, and travel. Which of the following questions is LEAST likely to be answerable using the trends feature?

What is the cost of a certain electronics product?

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

9. A programmer wrote the program below. The program uses a list of numbers called numList. The program is intended to display the sum of the numbers in the list. In order to test the program, the programmer initializes numList to [0, 1, 4, 5]. The program displays 10, and the programmer concludes that the program works as intended. Which of the following is true? (A) The conclusion is correct; the program works as intended. (B) The conclusion is incorrect; the program does not display the correct value for the test case [0, 1, 4, 5]. (C) The conclusion is incorrect; using the test case [0, 1, 4, 5] is not sufficient to conclude the program is correct. (D) The conclusion is incorrect; using the test case [0, 1, 4, 5] only confirms that the program works for lists in increasing order.

c) The conclusion is incorrect; using the test case [0, 1, 4, 5] is not sufficient to conclude the program is correct.

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_counterand flip_counterto 0. Step 2 : A variable coin_flipis randomlyassigned a value of either 0 or 1. If coin_fliphas the value 0, the coin flip result is heads, so heads_counteris incremented by 1. Step 3 : Increment the value of flip_counterby 1. Step 4 : Repeat steps 2 and 3 until flip_counterequals 4. Following execution of the algorithm, which of the following expressions indicates that the simulation resulted in an equal number of heads and tails?

heads_counter=2

Consider the following code segment. j=1 Repeat until <MISSING CONDITION> j=j+2 Which of the following replacements for <MISSING CONDITION> will result in an infinite loop?

j=6


Set pelajaran terkait

Infectious and Noninfectious Diseases

View Set

Ancient Greece: Peloponnesian Wars

View Set

Nclex review ( health promotion and maintenance)

View Set

Intellipath Unit 2 - Market Equilibrium

View Set