AP computer Science

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. How many programmer-defined world-level methods are called when the world is run? (2) (A) 2 (B) 4 (C) 6 (D) 7

(A) 2

he following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. How many programmer-defined world-level methods are called when the world is run? (2) (A) 2 (B) 4 (C) 6 (D) 7

(A) 2

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? (2) (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 ma

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

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? (2) (A) The song was saved using fewer bits per second than the original song. (B) The song was saved using more bits per second than the original song. (C) The song was saved using a lossless compression technique. (D) Some information is lost every time a file is saved from one location on a computer to another location.

(A) The song was saved using fewer bits per second than the original song.

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? (2) (A) Which items listed in the database are not currently in the store (B) Which colors are more popular among men than women (C) Which type of footwear is most popular among adults (D) The total number of shoes sold in a particular month

(A) Which items listed in the database are not currently in the store

Which of the following lists the numbers in order from least to greatest? (2) (A) Binary 1100, Decimal 11, Hexadecimal D (B) Decimal 11, Binary 1100, Hexadecimal D (C) Decimal 11, Hexadecimal D, Binary 1100 (D) Hexadecimal D, Decimal 11, Binary 1100

(B) Decimal 11, Binary 1100, Hexadecimal D

If the following world-level method is called from "world.my first method", what value would be returned? (2) (A) True (B) False (C) A number (D) An object

(B) False

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? (2) (A) How long the program takes to run (B) How many programming statements the program contains (C) How much memory the program requires as it runs (D) How much storage space the program requires as it runs

(B) How many programming statements the program contains

Which of the following statements about security in the network is true? (2) Computers A and D need to communicate with at least two additional computers in the network in order to communicate with each other. 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

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? (2) (A) All elements in inputList1 followed by all elements in inputList2 (B) Only elements that appear in both inputList1 and inputList2 (C) Only elements that appear in either inputList1 or inputList2 but not in both lists (D) Only elements that appear in inputList1 but not in inputList2

(B) Only elements that appear in both inputList1 and inputList2

A local government uses Short Message Service (SMS) text messages to alert local residents when roads are closed. Which of the following are true statements regarding the benefits of using SMS text messages for the purpose described? (4) Select two answers. (A) SMS text messages are guaranteed to reach all residents affected by the road closures. (B) SMS text messages are likely to reach recipients quickly. (C) SMS text messages are useful for providing detailed detour instructions. (D) SMS text messages can be sent to multiple recipients.

(B) SMS text messages are likely to reach recipients quickly. (D) SMS text messages can be sent to multiple recipients

Which of the following is a characteristic of the fault-tolerant nature of routing on the Internet? (2) (A) The ability to use a hierarchical naming system to avoid naming conflicts (B) The ability to provide data transmission even when some connections have failed (C) The ability to resolve errors in domain name system (DNS) lookups (D) The ability to use multiple protocols such as hypertext transfer protocol (HTTP), Internet protocol (IP), and simple mail transfer protocol (SMTP) to transfer data

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

Which of the following is a characteristic of the fault-tolerant nature of routing on the Internet? (2) (A) The ability to use a hierarchical naming system to avoid naming conflicts (B) The ability to provide data transmission even when some connections have failed (C) The ability to resolve errors in domain name system (DNS) lookups (D) The ability to use multiple protocols such as hypertext transfer protocol (HTTP), Internet protocol (IP), and simple mail transfer protocol (SMTP) to transfer data

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

Which of the following programs is most likely to benefit from the use of a heuristic? (2) (A) A program that calculates a student's grade based on the student's quiz and homework scores (B) A program that encrypts a folder of digital files (C) A program that finds the shortest driving route between two locations on a map (D) A program that sorts a list of numbers in order from least to greatest

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

What ASCII character is represented by the binary (base 2) number 1001010 ? (A) H (B) I (C) J (D) K

(C) J

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? (2) (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.

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? (2) (A) In what month does a particular sport receive the most searches? (B) In which political candidates are people interested? (C) What is the cost of a certain electronics product? (D) Which region of the country has the greatest number of people searching for opera performances?

(C) What is the cost of a certain electronics product?

The code fragment below is intended to display "odd" if the positive number num is odd. Which of the following can be used to replace <MISSING CONDITION> so that the code fragment will work as intended? (2) (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

When the following code is executed, how many meters will the penguin move cumulatively? (2) (A) 0 meters (B) 2 meters 5 meters (D) 10 meters (E) 20 meters

(D) 10 meters

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

(D) I, II, and III

Given the following scene and code for the World.closer function. Alice is standing between a cow and a penguin. What value would be returned when a call to the function is executed?(2) (A) None (B) True (C) False (D) Unclear. We need more information.

(D) Unclear. We need more information.

The below loop moves a horse a random distance. After the code is run, where will the horse be with respect to its original position? (2) (A) Forward and to the left or right from its original position by more than 2 meters (B) Forward at most 2 meters, and to the left or right by at most 2 meters (C) The same place where it started (D) Unknown, because we do not know how many times the loop will run

(D) Unknown, because we do not know how many times the loop will run

How far away are the penguin and chicken from each other after the following code is run? The two animals are initially 3 meters away from each other. (2) (A) 0 meters - they are in the same place (B) 4 meters (C) 6 meters (D) 9 meters (E) the code never ends - it is an infinite loop (F) none of the above

(E) the code never ends - it is an infinite loop

The following Alice world contains a guy on the beach, randomGuy2, a beach ball, a beach chair, and a Frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. The beach ball and beach chair are 4 meters apart. How many times will the "kick" method be called? (2) (A) 0 times - kick will never get called (B) once (C) twice (D) three times (E)Unknown number of times because the orientation of the beach ball is unknown

(E)Unknown number of times because the orientation of the beach ball is unknown

A chicken and penguin are initially separated by 3 meters. In the following code, how far does the penguin move? (2) 0 meters - the penguin does not move 1.5 meters 3 meters 4.5 meters

1.5 meters

The initial scene below consists of a single penguin How much collective distance does the penguin move when the following code is executed? (2) 1 meter 2 meters 3 meters Doesn't move

2 meters

A chicken and penguin are initially separated by 3 meters. In the following code, how far does the penguin move? (2) 0 meters - the penguin does not move 1.5 meters 3 meters 4.5 meters

4.5 meters

How does a linear search work compared to a binary search to find a target value in a sorted test?

A linear search looks down a list, one item at a time, without jumping. In complexity terms this is an O(n) search - the time taken to search the list gets bigger at the same rate as the list does. A binary search is when you start with the middle of a sorted list, and see whether that's greater than or less than the value you're looking for, which determines whether the value is in the first or second half of the list. Jump to the half way through the sublist, and compare again etc. This is pretty much how humans typically look up a word in a dictionary (although we use better heuristics, obviously - if you're looking for "cat" you don't start off at "M").

The below Alice code features a dump truck and a tumbleweed. The dump truck is 3 meters behind the tumbleweed, facing the tumbleweed. When the code is executed, how far (total distance) will the dump truck travel? (2) (A) 1 meter (B) 2 meters (C) 3 meters (D) 5 meters

A) 1 meter

. What is displayed as a result of executing the algorithm in the flowchart? (2) A) 5 B 15 C 1 2 3 4 D) 2 3 4 5 333.

A) 5

Which of the following can be represented by single binary digit? Select two answers. (4) (A) The position of the minute hand of a clock (B) The remainder when dividing a whole number by 2 (C) The value of a Boolean variable (D) The volume of a car radio

B) The remainder when dividing a whole number by 2 (C) The value of a Boolean variable

28. 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? (2) 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? (2) (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

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? (2) (A) Compressing the image in a way that may lose information but will suffer only a small loss of image quality. (B) Creating the gray scale of an image by averaging the amounts of red, green, and blue in each pixel and assigning this new value to the corresponding pixel in the new image. The new value of each pixel represents a shade of gray, ranging from white to black. (C) Creating the negative of an image by creating a new RGB 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. (D) Modifying part of the image by taking the pixels in one part of the picture and copying them to the pixels in another part of the picture.

C) Creating the negative of an image by creating a new RGB 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.

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? (2) (A) Iteration (B) Searching (C) Selection (D) Sequencing

C. Selection

Suppose the penguin is initially 4 meters away from the chicken. How many times will the penguin speak when the following code is run? (2) (A) 0 times (B) 1 time (C) 2 times (D) 3 times

D) 3 times


Kaugnay na mga set ng pag-aaral

Week 5 - Decision Making Under Uncertainty

View Set

Unmanned Aircraft Safety Guidelines

View Set

Skip to main content Conéctate al cine (2)

View Set

JMESI External Accreditation One 1

View Set

Chapter 2 mental health nursing psychopharmacology

View Set