Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Broward County Public Schools
AP Review
Computer Science Principles
Vijayshree Sundar
McFatter Technical High School and College
Multiple choice questions
1. A binary question is defined as
a. A piece of information that is sent in pairs
b. Two questions which share the same answer
c. A message which has two possible states
d. A question which can be answered in only one of the two possible ways
2. A binary message consisting of four bits was sent to you by a friend. The message was
supposed to be ABAB. Unfortunately your friend sent the bit on the wire once every 2
seconds, but you read the wire once every second. Assuming that the first bit was sent
and read at the same time, what message did you receive instead?
a. ABAB
b. AABB
c. AAAA
d. BBBB
e. ABBB
3. When sending a response to a question with four possible answers, the most efficient
method will require no more than how many bits?
a. 5 bits
b. 4 bits
c. 3 bits
d. 2 bits
e. 1 bit
4. If you had two different shapes ( a circle and a square) how many 3 place patterns can
you make?
a. 4
b. 6
c. 8
d. 10
e. 12
5. What is the minimum number of bits you will need to encode the 26 letters of the
alphabet plus a space?
a. 2 bits
b. 3 bits
c. 4 bits
d. 5 bits
e. 6 bits
6. A standard QWERTY keyboard has 47 characters that can place characters on the
screen. Each of these keys can also display a second character by holding the “Shift”
key at the same time. How many bits would you need to encode everything that could be
typed on this keyboard?
a. 3 bits
b. 4 bits
c. 5 bits
d. 7 bits
e. 12 bits
7. ASCII is an acronym for
a. American Standard Cryptography Information Instruction
b. American Standard Code for Information Interchange
c. American Standard Cipher for Information Instruction
d. None of the above
8. ASCII has an encoding for every character of the alphabet as well as encodings for
numbers-- that is encodings for the symbols of the digits 0 - 9. How many bits are
required to store the text of the number “200” in ASCII?
a. 3 bits
b. 8 bits
c. 16 bits
d. 24 bits
e. 32 bits
9. The Internet is composed of many layers. Higher level layers depend on the functionality
of the lower levels without worrying about precisely how those layers work. These layers
in order from lower to higher are:
a. Physical network, IP, TCP
b. IP, Physical network, TCP
c. TCP, IP, Physical network
d. Physical Network, TCP, IP
10. The Internet Engineering Task Force (IETF) defines the protocols and standards for how
the Internet works. The members of the IETF are:
a. An international coalition of government agencies who oversee the Internet in
their countries
b. The worldwide leaders of the Tier 1 internet service providers
c. A loosely organized collection of citizens and engineers who communicate
mostly by email
d. Political leaders and heads of state
e. There are no members. IETF is an “organization” in name only
11. What is an RFC?
a. Restricted Fiduciary Contract
b. Request for Comments
c. Radio Frequency Controller
d. Related Fundamental Content
e. ReFactored Code
12. If I understand how the Internet works then I will be able to : (two correct responses)
a. Make informed choices to support or oppose decisions my government makes
about access to the Internet
b. Connect the latest devices to the Internet
c. Make informed choices about my privacy on the internet
d. Get the best price for my cell phone plan
e. Speed up my downloads of movies I purchase.
13. Why is digital data represented in binary in computers?
a. The binary number system is the only system flexible enough to allow for
representing data other than numbers
b. As a consequence of history; early pioneers of computing were making secret
codes in binary, and this simply evolved into modern computing.
c. It’s impossible to build a computing machine that uses anything but binary to
represent numbers
d. It’s easier, cheaper, and more reliable to build machines and devices that only
have to distinguish between binary states
14. A user clicks on a website, and it begins to load immediately, but it take a long time for
the pictures to load completely and pictures appear slowly, one by one. Which of the
following is demonstrated by this situation?
a. High bandwidth, high latency
b. Low bandwidth, high latency
c. High bandwidth, low latency
d. Low bandwidth, low latency
15. A video streaming website uses 32 bit integers to count the number of times each video
is played. In anticipation of some videos being played more times than can be
represented with 32 bits, the Web site is planning to change to 64 bit integers for the
counter. Which of the following best describes the result of using 64 bit integers instead
of 32 bit integers?
a. 2 times as many values can be represented
b. 32 times as many values can be represented
c. 2^32 times as many values can be represented
d. 32^2 times as many values can be represented
16. What is NOT the difference between IP address and IP packet?
a. IP addresses are 32 bits, typically written as 4 dotted quads; an IP packet is a
message of data that includes information to route the message from the source
to the destination computer
b. IPv4 doesn’t provide enough addresses, so IPv6 uses 128 bit addresses
c. An IP packet contains an IP addresses AND the data is intended for the machine
identified by the IP address.
d. An IP address is a sequence of numbers used to identify a device on the IP
network. An IP packet is a datagram.
17. Which of the following statements are true about routers and routing on the Internet.
Choose two answers.
a. Protocols ensure that a single path between two computers is established
before sending packets over it.
b. Routers are hierarchical and the "root" router is responsible for communicating
to sub-routers the best paths for them to route internet traffic.
c. A packet traveling between two computers on the Internet may be rerouted
many times along the way or even lost or "dropped".
d. Routers act independently and route packets as they see fit.
18. The advent of technology has increased the opportunity for many people to access the
Internet. With this growth comes the need for increase in network’s capacity for large
amount of data travel. Which of the following terms defines this measurement?
a. Baud rate
b. Broadband
c. Latency
d. Bandwidth
19. Which of the following BEST describes how protocols on the Internet (eg IP, TCP,
HTTP) make use of abstraction to accomplish their respective purposes?
a. High level protocols take into account specific implementation details of lower
level protocols to ensure they are compatible
b. Low level protocols can provide functionality to high level protocols without
revealing the details of how this is accomplished
c. Low level protocols are written in binary while high level protocols are written in
hexadecimal
d. High level protocols can take on the role of a low level protocol in the event of a
failure in the system
20. According to the Domain Name System (DNS) which of the following is a subdomain of
the domain www.code.org
a. code.org/ s/course 1
b. Studio.code.org
c. code.org/subdomain/forum
d. Code.org
21. Two classmates working on a project together don’t want any of their classmates to be
able to read their work, so they decide to use Caesar’s Cipher where the letters are
shifted left or right to encrypt their work. Caesar’s Cipher is an example of which kind of
encryption?
a. Private key encryption
b. Symmetric encryption
c. Public key encryption
d. Asymmetric encryption
22. One of the interesting job descriptions has the following text; “Accessing data and
computing power without being granted access but with the permission of the system
administrators…. Their job is to identify and repair system vulnerabilities.” Which of the
following jobs is being described here?
a. Hacking
b. Penetration testing
c. Privilege escalation
d. Black hatting
23. Numbers can be represented in multiple bases. For example in the octal system we can
represent 8 digits, numbers are expressed in octal with a subscript 8. What is the octal
representation of the decimal number 25?
a. 31
b. 14
c. 30
d. 160
24. What base could the number 23 be in
I octal(base 8)
II decimal (base 10)
III hexadecimal ( base 16)
a. I and II only
b. I and III only
c. II and III
d. I, II, and III
25. A programmer has a choice between a higher level and lower level programming
language to use. Which should she choose and why?
a. The higher level language, because the language itself will be less complex, and
there will be fewer errors
b. The lower level language, because it offers more flexibility for complex programs
c. It depends on her needs, as a high level language will be less complex, but will
not allow as much freedom as a lower level language
d. Either language, because both languages will be converted to a lower level
language to be executed on the computer.
26. What will be the value of var3 after the following code executes?
var 1 = “cat”, var2 = “dog”, var3 = “bird”,var1 = var2, var3 = var1,var2 = “fish”
a. Dog
b. Fish
c. cat
d. Bird
27. A named space that can hold a value is which of the following?
a. Variable
b. Turtle
c. String
d. Program
28. In which way does y increase on an image?
a. From left to right
b. From right to left
c. From top to bottom
d. From bottom to top
29. What will be the result of 18 % 5?
a. 0
b. 1
c. 2
d. 3
30. App Inventor is an example of which of the following (choose all that apply)
a. A cloud application
b. An integrated development environment (IDE)
c. A software system for developing mobile apps that may be run on Android, iOS, and
other mobile platforms
d. A programming language
31. Which of the following elements would be considered part of the user interface(UI) for an
app? Choose all that apply
a. A button that appears on the screen
b. An audible click that happens when the user taps the button
c. An error message that appears when something goes wrong
d. The app’s memory usage
e. The color of the app’s background screen
32. Which of the following would be considered an event on your smartphone? Choose all that
apply
a. The user taps on the screen
b. The phone receives a text message
c. The phone;s location changes
d. The app plays a sound clip
e. The phone’s internal clock ticks
33. The Internet ____________________(choose all that applies)
a. Is a network of networks
b. Was invented by Tim Berners-Lee
c. Connects devices and computers around the world
d. Is based on the Internet protocol suite
34. The World Wide Web (WWW) __________ (choose all that applies)
a. Is a system of interlinked hypertext documents
b. Uses the HTTP protocol
c. Is maintained by Google and Facebook
d. Was invented by Tim Berners-Lee
35. Which of the following is an example of a cloud computing application? Choose all that
applies
a. Twitter
b. Excel
c. Gmail
d. PowerPoint
e. Facebook
f. DropBox
36. Which of the following are advantages of cloud computing? Choose all that applies
a. Cloud computing relieves users from having to backup their own data and information
b. Cloud computing makes it easier to share information
c. Information is stored on each user’s computer
d. Users can access information that is on the cloud from anywhere that has an Internet
Connection.
37. An overflow error occurs when there aren’t enough bits to represent a given number. Which
of the following would cause an overflow error to occur (choose all that apply)
a. Trying to represent 15 in 4 bits
b. Trying to represent 16 in 4 bits
c. Trying to represent 31 in 5 bits
d. Trying to represent 32 in 5 bits
38. Which of the following lists arranges hardware components from the lowest to the highest
a. Ram chip, motherboard, logic gate, physical circuit
b. Physical circuit, motherboard, logic gate, ram chip
c. Physical circuit, logic gate, ram chip, motherboard
d. Ram chip, logic gate, physical circuit, motherboard
39. Which of the following is FALSE about event-driven programs?
a. Event driven programs do not implement algorithms
b. Some portions of an event driven program may never execute while the program is
running
c. An event driven program is written to respond to specified events by executing a block of
code or function associated with the event
d. The order in which an event driven program will run cannot always be known ahead of
time
e. Event driven programs can be run multiple times with different outcomes, based on user
interactions.
40. Which of the following are actions that a programmer could take when debugging a segment
of code that would most likely lead to finding a problem and fixing it? (choose two)
a. Change the names of the variables within the program and run the program again
b. Display the value of variables at various points during the program
c. Ask a friend or collaborator to look over the code segment to see if they are able to find
any errors
d. Delete the code and retype it to make sure that there are not spelling error and that it
was written correctly
41. Which of the following is not an advantage of using simulation to solve a problem?
a. The best solution can be found quickly
b. The simulation may save money compared to constructing a physical system
c. The simulation may save time compared to constructing a physical system
d. The simulation may create new questions
42. Analytics is the computational analysis of data. There are many types of analytics that
people can use to properly process large data sets. Which of the following analytics type is
defined incorrectly?
a. Operationalized - analytics becomes a part of the business process
b. Basic - analytics used for data manipulation, simple visualizations, and monitoring
c. Monetized - analytics that require fees to be paid in order to access and process the
data
d. Advanced - analytics used for predictive modeling and pattern matching
43.
44.
45.
46.
47.
48. Which of the following statements describes a limitation of using a computer simulation to model a real-
world object or system?
(A) Computer simulations can only be built after the real-world object or system has been
created.
(B) Computer simulations only run on very powerful computers that are not available to the
general public.
(C) Computer simulations usually make some simplifying assumptions about the real-world
object or system being modeled. (D) It is difficult to change input parameters or conditions when using computer simulations
49. Under which of the following conditions is it most beneficial to use a heuristic approach to solve a
problem?
(A) When the problem can be solved in a reasonable time and an approximate solution is
acceptable
(B) When the problem can be solved in a reasonable time and an exact solution is needed
(C) When the problem cannot be solved in a reasonable time and an approximate solution is
acceptable
(D) When the problem cannot be solved in a reasonable time and an exact solution is needed
50.Which of the following are true statements about digital certificates in Web browsers?
I. Digital certificates are used to verify the ownership of encrypted keys used in
secured communication.
II. Digital certificates are used to verify that the connection to a Web site is fault tolerant.
(A) I only
(B) II only
(C) I and II
(D) Neither I nor II
51.Which of the following is a true statement about data compression?
(A) Data compression is only useful for files being transmitted over the Internet.
(B) Regardless of the compression technique used, once a data file is compressed, it cannot be
restored to its original state.
(C) Sending a compressed version of a file ensures that the contents of the file cannot be
intercepted by an unauthorized user.
(D) There are trade-offs involved in choosing a compression technique for storing and
transmitting data.
52. Which of the following algorithms require both selection and iteration? Select two answers.
(A) An algorithm that, given two integers, displays the greater of the two integers
(B) An algorithm that, given a list of integers, displays the number of even integers in the list
(C) An algorithm that, given a list of integers, displays only the negative integers in the list (D) An algorithm that, given a list of integers, displays the sum of the integers in the list
53.The figure below shows a circuit composed of two logic gates. The output of the
circuit is true.
Which of the following is a true statement about input A?
(A) Input A must be true.
(B) Input A must be false.
(C) Input A can be either true or false.
(D) There is no possible value of input A that will cause the circuit to have the output true.
54. An office building has two floors. A computer program is used to control an elevator that travels between the
two floors. Physical sensors are used to set the following Boolean variables.
Variable Description
onFloor1 set to true if the elevator is stopped on floor 1; otherwise set to false
onFloor2 set to true if the elevator is stopped on floor 2; otherwise set to false
callTo1 set to true if the elevator is called to floor 1; otherwise set to false
callTo2 set to true if the elevator is called to floor 2; otherwise set to false
The elevator moves when the door is closed and the elevator is called to the floor that it is not
currently on. Which of the following Boolean expressions can be used in a selection
statement to cause the elevator to move?
(A) (onFloor1 AND callTo2) AND (onFloor2 AND callTo1)
(B) (onFloor1 AND callTo2) OR (onFloor2 AND callTo1)
(C) (onFloor1 OR callTo2) AND (onFloor2 OR callTo1)
(D) (onFloor1 OR callTo2) OR (onFloor2 OR callTo1)
55.A teacher uses the following program to adjust student grades on an assignment by adding 5 points to each
student’s original grade. However, if adding 5 points to a student’s original grade causes the grade to exceed
100 points, the student will receive the maximum possible score of 100 points. The students’ original grades
are stored in the list gradeList, which is indexed from 1 to n. i ← 1
REPEAT n TIMES
{
<MISSING CODE> i ← i +
1
}
The teacher has the following procedures available.
Procedure Explanation
min (a, b) Returns the lesser of the two values a and b
max (a, b) Returns the greater of the two values a and b
Which of the following code segments can replace <MISSING CODE> so that the
program works as intended?
Select two answers.
(A) gradeList[i] ← min (gradeList[i] + 5, 100)
(B) gradeList[i] ← max (gradeList[i] + 5, 100)
(C) gradeList[i] ← gradeList[i] + 5 IF (gradeList[i] > 100) { gradeList[i] ← gradeList[i] - 5 }
(D) gradeList[i] ← gradeList[i] + 5
IF (gradeList[i] > 100) { gradeList[i] ← 100 }
56. Consider the following program code.
Which of the following best describes the result of running the program code?
(A) The number 0 is displayed.
(B) The number 6 is displayed.
(C) The number 10 is displayed.
(D) Nothing is displayed; the program results in an infinite loop.
57.A summer camp offers a morning session and an afternoon session. The list morningList contains the
names of all children attending the morning session, and the list afternoonList contains the names of all
children attending the afternoon session.
Only children who attend both sessions eat lunch at the camp. The camp director wants to create
lunchList, which will contain the names of children attending both sessions.
The following code segment is intended to create lunchList, which is initially empty. It
uses the procedure IsFound (list, name), which returns true if name is found in
list and returns false otherwise.
FOR EACH child IN morningList {
<MISSING CODE> }
Which of the following could replace <MISSING CODE> so that the code segment works
as intended? (A) IF (IsFound (afternoonList, child))
{ APPEND (lunchList, child)
} (B) IF (IsFound (lunchList, child))
{ APPEND (afternoonList, child)
} (C) IF (IsFound (morningList, child))
{ APPEND (lunchList, child)
}
(D) IF ((IsFound (morningList,
child)) OR (IsFound (afternoonList,
child)))
{ APPEND (lunchList, child)
}
58.The figure below shows a robot in a grid of squares. The robot is represented as a triangle, which is
initially facing upward. The robot can move into a white or gray square but cannot move into a black region.
Consider the procedure MoveAndTurn
below.
Which of the following code segments will move the robot to the gray square? (A) (B)
(C) (D)
59. There are 32 students standing in a classroom. Two different algorithms are given for finding the average
height of the students.
Algorithm A
Step 1: All students stand.
Step 2: A randomly selected student writes his or her height on a card and is seated.
Step 3: A randomly selected standing student adds his or her height to the value on the card, records
the new value on the card, and is seated. The previous value on the card is erased.
Step 4: Repeat step 3 until no students remain standing.
Step 5: The sum on the card is divided by 32. The result is given to the teacher.
Algorithm B
Step 1: All students stand.
Step 2: Each student is given a card. Each student writes his or her height on the card.
Step 3: Standing students form random pairs at the same time. Each pair adds the numbers
written on their cards and writes the result on one student’s card; the other student is
seated. The previous value on the card is erased.
Step 4: Repeat step 3 until one student remains standing.
Step 5: The sum on the last student’s card is divided by 32. The result is given to the
teacher.
Which of the following statements is true?
(A) Algorithm A always calculates the correct average, but Algorithm B does not.
(B) Algorithm B always calculates the correct average, but Algorithm A does not.
(C) Both Algorithm A and Algorithm B always calculate the correct average.
(D) Neither Algorithm A nor Algorithm B calculates the correct average.
60. An online gaming website has a list of users that has been sorted alphabetically by last
name. In order to find a certain user, a binary search is performed. As many new members are
added to the database, will the number of steps the algorithm will take to solve the problem
most likely also increase. Why or Why not?
a. Yes, the number of steps in an algorithm changes proportional to the size of the input.
b. Yes, because the new members may not be added alphabetically
c. Np, the program is written already, and will take the same number of steps regardless of
the size of the database.
d. No, because the search is binary, so the dataset is split in half with every iteration.