AP CSP 2018 Practice Exam Guide
AP CSP 2018 Practice Exam Guide
You have 2 hours for this exam. Open your exam booklet and begin.
Note Start Time here______ . Note Stop Time here______ . After 2 hours, say:
Stop working. The exam is over. I will now collect your exam materials.
2 2 2 2 2 2 2 2 2 2 2 8 2 2 2 2 2 2 2 2 2 2 2 2 2 2
B. LEGAL NAME Omit apostrophes, Jr., II. 3 3 3 3 3 3 3 3 3 3 3 9 3 3 3 3 3 3 3 3 3 3 3 3 3 3
Legal Last Name — First 15 Letters Legal First Name — First 12 Letters MI 4 4 4 4 4 4 4 4 4 4 10 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5 5 5 5 5 5 5 5 5 5 11 5 5 5 5 5 5 5 5 5 5 5 5 5 5
A A A A A A A A A A A A A A A A A A A A A A A A A A A A 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
B B B B B B B B B B B B B B B B B B B B B B B B B B B B 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
C C C C C C C C C C C C C C C C C C C C C C C C C C C C 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
D D D D D D D D D D D D D D D D D D D D D D D D D D D D 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
E E E E E E E E E E E E E E E E E E E E E E E E E E E E
COMPLETE THIS AREA ONLY ONCE. K. DATE OF BIRTH
F F F F F F F F F F F F F F F F F F F F F F F F F F F F I. AREA CODE AND
G G G G G G G G G G G G G G G G G G G G G G G G G G G G PHONE NUMBER J. SCHOOL YOU ATTEND Month Day Year
SCHOOL CODE School Name
H H H H H H H H H H H H H H H H H H H H H H H H H H H H Jan
I I I I I I I I I I I I I I I I I I I I I I I I I I I I 0 0 0 0 0 0 0 0 0 0 Feb 0 0 0 0
J J J J J J J J J J J J J J J J J J J J J J J J J J J J 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 Mar 1 1 1 1
K K K K K K K K K K K K K K K K K K K K K K K K K K K K 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 Apr 2 2 2 2
L L L L L L L L L L L L L L L L L L L L L L L L L L L L 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 May 3 3 3 3
M M M M M M M M M M M M M M M M M M M M M M M M M M M M 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 City Jun 4 4 4
N N N N N N N N N N N N N N N N N N N N N N N N N N N N 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 Jul 5 5 5
O O O O O O O O O O O O O O O O O O O O O O O O O O O O 6 6 6 6 6 6 6 6 6 6 5 5 5 5 5 5 State Aug 6 6 6
P P P P P P P P P P P P P P P P P P P P P P P P P P P P 7 7 7 7 7 7 7 7 7 7 6 6 6 6 6 6 Sep 7 7 7
Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q 8 8 8 8 8 8 8 8 8 8 7 7 7 7 7 7 Oct 8 8 8
Country
R R R R R R R R R R R R R R R R R R R R R R R R R R R R 9 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 Nov 9 9 9
S S S S S S S S S S S S S S S S S S S S S S S S S S S S INTERNATIONAL PHONE 9 9 9 9 9 9 Dec
T T T T T T T T T T T T T T T T T T T T T T T T T T T T
M. COLLEGE TO RECEIVE YOUR
U U U U U U U U U U U U U U U U U U U U U U U U U U U U N. CURRENT
L. SOCIAL SECURITY AP SCORE REPORT
GRADE LEVEL
V V V V V V V V V V V V V V V V V V V V V V V V V V V V NUMBER (Optional) COLLEGE CODE Using the college code listed
in the AP Student Pack,
indicate the ONE college Not yet in
W W W W W W W W W W W W W W W W W W W W W W W W W W W W 11th
that you want to receive 9th grade
X X X X X X X X X X X X X X X X X X X X X X X X X X X X 0 0 0 0 0 0 0 0 0 0 0 0 0 your AP score report. 9th 12th
Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y 1 1 1 1 1 1 1 1 1 1 1 1 1 College Name 10th No longer in
high school
Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z 2 2 2 2 2 2 2 2 2 2 2 2 2
Q4546/1-4
801356 If you don’t answer and previously chose to
Section Number Fee Reduction Granted 8 8 8 8 8 8 8 8 8 8 8 8 8 Country participate in this service, we will continue
1 2 3 4 5 6 7 8 9 1 Option 1 2 Option 2 9 9 9 9 9 9 9 9 9 9 9 9 9 providing your information.
PAGE 2
COMPLETE THIS AREA AT EACH EXAM (IF APPLICABLE).
P. SURVEY QUESTIONS — Answer the survey questions in the AP Student Pack. Do not put responses to exam questions in this section.
1 A B C D E F G H I 4 A B C D E F G H I 7 A B C D E F G H I
2 A B C D E F G H I 5 A B C D E F G H I 8 A B C D E F G H I
3 A B C D E F G H I 6 A B C D E F G H I 9 A B C D E F G H I
If this answer sheet is for the French Language and Culture, German Language and Culture, Italian Language and Culture, Spanish Language
and Culture, or Spanish Literature and Culture Exam, please answer the following questions. Your responses will not affect your score.
1. Have you lived or studied for one month or more in a country where the language of the 2. Do you regularly speak or hear the language at home?
exam you are now taking is spoken?
Yes No Yes No
QUESTIONS 1–75
Indicate your answers to the exam questions in this section (pages 2 and 3). Mark only one response per question
for Questions 1 through 120. If a question has only four answer options, do not mark option E. Answers written in
the multiple-choice booklet will not be scored.
A B C D You must use a No. 2 pencil and marks must be complete. Do not use a mechanical pencil. It
EXAMPLES OF
COMPLETE MARK is very important that you fill in the entire circle darkly and completely. If you change your response,
INCOMPLETE MARKS A B C D erase as completely as possible. Incomplete marks or erasures may affect your score.
1 A B C D E 26 A B C D E 51 A B C D E
2 A B C D E 27 A B C D E 52 A B C D E
3 A B C D E 28 A B C D E 53 A B C D E
4 A B C D E 29 A B C D E 54 A B C D E
5 A B C D E 30 A B C D E 55 A B C D E
6 A B C D E 31 A B C D E 56 A B C D E
7 A B C D E 32 A B C D E 57 A B C D E
8 A B C D E 33 A B C D E 58 A B C D E
9 A B C D E 34 A B C D E 59 A B C D E
10 A B C D E 35 A B C D E 60 A B C D E
11 A B C D E 36 A B C D E 61 A B C D E
12 A B C D E 37 A B C D E 62 A B C D E
13 A B C D E 38 A B C D E 63 A B C D E
14 A B C D E 39 A B C D E 64 A B C D E
15 A B C D E 40 A B C D E 65 A B C D E
16 A B C D E 41 A B C D E 66 A B C D E
17 A B C D E 42 A B C D E 67 A B C D E
18 A B C D E 43 A B C D E 68 A B C D E
19 A B C D E 44 A B C D E 69 A B C D E
20 A B C D E 45 A B C D E 70 A B C D E
21 A B C D E 46 A B C D E 71 A B C D E
22 A B C D E 47 A B C D E 72 A B C D E
23 A B C D E 48 A B C D E 73 A B C D E
24 A B C D E 49 A B C D E 74 A B C D E
25 A B C D E 50 A B C D E 75 A B C D E
Be sure each mark is dark and completely fills the circle. If a question has only four answer options, do not mark option E.
76 A B C D E 91 A B C D E 106 A B C D E
77 A B C D E 92 A B C D E 107 A B C D E
78 A B C D E 93 A B C D E 108 A B C D E
79 A B C D E 94 A B C D E 109 A B C D E
80 A B C D E 95 A B C D E 110 A B C D E
81 A B C D E 96 A B C D E 111 A B C D E
82 A B C D E 97 A B C D E 112 A B C D E
83 A B C D E 98 A B C D E 113 A B C D E
84 A B C D E 99 A B C D E 114 A B C D E
85 A B C D E 100 A B C D E 115 A B C D E
86 A B C D E 101 A B C D E 116 A B C D E
87 A B C D E 102 A B C D E 117 A B C D E
88 A B C D E 103 A B C D E 118 A B C D E
89 A B C D E 104 A B C D E 119 A B C D E
90 A B C D E 105 A B C D E 120 A B C D E
QUESTIONS 121–126
/ / / / / / / / / / / / / / / / / /
– . . . . . – . . . . . – . . . . . – . . . . . – . . . . . – . . . . .
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
QUESTIONS 131–142
© 2017 The College Board. College Board, AP, Student Search Service and the acorn logo are registered trademarks of the College Board.
10
COMPLETE THIS AREA ONLY ONCE. PAGE 4
R. YOUR MAILING ADDRESS Use the address abbreviations from your AP Student Pack. Fill in only one circle per column. Indicate a space in your address by leaving a blank box; do not grid that column. V. SEX
COUNTRY
STREET ADDRESS (include street number, street name, apartment number, etc.) CITY ZIP OR POSTAL CODE
CODE Female Male
E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E 4 4 4
F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F 5 5 5 X. RACIAL/ETHNIC GROUP
J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J 9 9 9
(You may mark all that apply.)
K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K
a. Are you of b. What is your race?
L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L Hispanic,
Latino, or
American Indian or
M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M Spanish origin? Alaska Native
N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N No, not of Asian (including Indian
Hispanic, Latino, subcontinent and
O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O or Spanish origin Philippines origin)
U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U
V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V Y. PARENTAL EDUCATION LEVEL
In the first column, indicate the highest level of education of
W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W
one parent/guardian, and indicate whether this is your mother/
X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X female guardian or father/male guardian. Then, if applicable,
indicate the highest level of education of your other parent/
Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y guardian in the second column, and indicate whether this is
Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z your mother/female guardian or father/male guardian.
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 AL IA MO OK WI 2 2 2 2 2 2 2 2 2 Grade school
By providing your email address, you are granting the College Board
U. EMAIL ADDRESS permission to use your email address in accordance with the policies
in the 2017-18 Bulletin for AP Students and Parents.
Multiple Choice
Programming reference materials are included on the following pages. As AP Computer Science Principles does not
designate any particular programming language, these reference materials provide instructions and explanations to help
you understand the format and meaning of the questions you will see on the exam. The reference materials include two
programming formats, text-based and block-based.
Programming instructions use four data types: numbers, Booleans, strings, and lists.
Instructions from any of the following categories may appear on the exam:
• Assignment, Display, and Input
• Arithmetic Operators and Numeric Procedures
• Relational and Boolean Operators
• Selection
• Iteration
• List Operations
• Procedures
• Robot
Instruction Explanation
Assignment, Display, and Input
Text: Evaluates expression and assigns the result to
a ← expression the variable a.
Block:
Instruction Explanation
Relational and Boolean Operators (continued)
Text: Evaluates to true if condition1 is true
condition1 OR condition2 or if condition2 is true or if both
condition1 and condition2 are true;
Block:
otherwise evaluates to false.
Selection
Text: The code in block of statements is
IF (condition) executed if the Boolean expression condition
{ evaluates to true; no action is taken if
<block of statements> condition evaluates to false.
}
Block:
Iteration
Text: The code in block of statements is
REPEAT n TIMES executed n times.
{
<block of statements>
}
Block:
List Operations
For all list operations, if a list index is less than 1 or greater than the length of the list, an error message
is produced and the program terminates.
Text: Refers to the element of list at index i. The
list[i] first element of list is at index 1.
Block:
Procedures
Text: A procedure, name, takes zero or more
PROCEDURE name (parameter1, parameters. The procedure contains programming
parameter2, ...) instructions.
{
<instructions>
}
Block:
Block:
Instruction Explanation
Robot
If the robot attempts to move to a square that is not open or is beyond the edge of the grid, the robot will
stay in its current location and the program will terminate.
Text: The robot moves one square forward in the
MOVE_FORWARD () direction it is facing.
Block:
1. The code segment below is intended to swap the values of the variables first and second using a
temporary variable, temp.
Which of the following can be used to replace <MISSING CODE> so that the code segment works as
intended?
(A)
(B)
(C)
(D)
2. A bank customer receives an e-mail from a sender claiming to be a bank employee. The e-mail asks the
customer to provide personal information and to call a phone number if he or she has any questions. The
customer suspects the e-mail might be a phishing attempt. Which of the following responses is most likely to be
a privacy risk for the bank customer?
(A) Calling the bank at its official phone number to ask whether the request for personal information is
legitimate
(B) Calling the phone number given in the e-mail and providing the personal information over the phone
(C) Checking that the domain name of the sender’s e-mail address is associated with the bank
(D) Conducting a Web search to see if other people have received similar requests for personal information
(A) An experiment that requires all participants to be working in the same laboratory
(B) An experiment that requires expensive equipment to conduct
(C) An experiment that requires data measurements to be taken in many different locations
(D) An experiment that requires specialized knowledge and training to conduct
4. A student is writing a program to model different real-world events using simulations. Which of the following
simulations will generate a result that would best be stored using a Boolean variable?
A programmer is creating an algorithm to set the value of ticketPrice based on the information in the
table. The programmer uses the integer variable age for the age of the moviegoer. The Boolean variable
is3D is true when the movie is 3-D and false otherwise.
Which of the following code segments correctly sets the value of ticketPrice ?
(A) (B)
(C) (D)
7. Consider the following program, which uses the variables start, end, and current.
start ← 1
end ← 20
current ← 3
start ← current
current ← current + 1
DISPLAY (start)
DISPLAY (current)
What is displayed as a result of executing the program?
(A) 1 3
(B) 3 3
(C) 3 4
(D) 4 4
Which of the following code segments can be used to draw the figure?
(A) xPos ← 3 (B) xPos ← 3
yPos ← 6 yPos ← 6
REPEAT 3 TIMES REPEAT 3 TIMES
{ {
DrawCircle (xPos, yPos, 2) DrawCircle (xPos, yPos, 2)
xPos ← xPos + 2 xPos ← xPos + 2
yPos ← yPos + 2 yPos ← yPos - 2
} }
Which of the following can be used to replace <MISSING CODE> so that the procedure correctly simulates
the spinner?
(A) (B)
12. The researchers noticed that the total number of registered users appears to be increasing at about a constant
rate. If this pattern continues, which of the following best approximates the total number of registered users, in
millions, in year 12 (two years after the last entry in the table) ?
(A) 30.6
(B) 31.2
(C) 31.8
(D) 32.4
13. Which of the following hypotheses is most consistent with the data in the table?
(A) The mobile app release did not have any effect on the average number of daily messages sent per
user.
(B) The mobile app release discouraged new user registration on the site.
(C) The mobile app release led to users being less frequently active on the site.
(D) The mobile app release led to users tending to write shorter messages.
Which of the following best compares the values displayed by programs A and B?
17. Which of the following actions could be used to help reduce the digital divide?
I. Providing free education and training on how to use computing devices
II. Providing free or low-cost computing devices to low-income
individuals
III. Providing networks and infrastructure to people in remote areas
A) III only
B) I and II only
C) II and III only
D) I, II, and III
19. A library of e-books contains metadata for each book. The metadata are intended to help a search feature find
books that users are interested in. Which of the following is LEAST likely to be contained in the metadata of each
e-book?
Which of the following code segments will move the robot to the gray square?
(A) (B)
(C) (D)
(A) (B)
(C) (D)
24. Which of the following statements about byte pair encoding is true?
(A) Byte pair encoding is an example of a lossy transformation because it discards some of the data in the
original string.
(B) Byte pair encoding is an example of a lossy transformation because some pairs of characters are replaced
by a single character.
(C) Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to
its original version.
(D) Byte pair encoding is an example of a lossless transformation because it can be used to transmit messages
securely.
25. For which of the following strings is it NOT possible to use byte pair encoding to shorten the string’s length?
(A) "BANANA"
(B) "LEVEL_UP"
(C) "MEET_ME_LATER"
(D) "NEITHER_HERE_NOR_THERE"
The code segment below uses the procedure GoalReached, which evaluates to true if the robot is in the
gray square and evaluates to false otherwise.
REPEAT UNTIL (GoalReached ())
{
<MISSING CODE>
}
Which of the following replacements for <MISSING CODE> can be used to move the robot to the gray
square?
(A) IF (CAN_MOVE (right)) (B) IF (CAN_MOVE (right))
{ {
ROTATE_RIGHT () ROTATE_RIGHT ()
} MOVE_FORWARD ()
MOVE_FORWARD () }
29. The diagram below shows a circuit composed of three logic gates. Each gate takes two inputs and produces a
single output.
For which of the following input values will the circuit have an output of false?
(A) A = true, B = false, C = false, D = false
(B) A = true, B = true, C = false, D = false
(C) A = false, B = false, C = true, D = true
(D) A = false, B = false, C = false, D = true
The following programs are each intended to move the robot to the gray square. Program II uses the
procedure GoalReached, which returns true if the robot is in the gray square and returns false
otherwise.
Which of the following hypotheses is most consistent with the data in the graph?
(A) Participants who read more were generally more likely to say they are interested in the application.
(B) Participants who read more were generally less likely to say they are interested in the application.
(C) Participants who use a smartphone more were generally more likely to say they read more.
(D) Participants who use a smartphone more were generally less likely to say they read more.
Block Explanation
The start or end of the algorithm
36. A computer program performs the operation 2 ÷ 3 and represents the result as the value 0.6666667.
Which of the following best explains this result?
(A) An overflow error occurred.
(B) The precision of the result is limited due to the constraints of using a floating-point representation.
(C) The program attempted to execute the operation with the arguments in reverse order.
(D) The program attempted to represent a floating-point number as an integer.
(A) Open standards and protocols allow different manufacturers and developers to build hardware and
software that can communicate with hardware and software on the rest of the network.
(B) Open standards and protocols provide ways for users to eliminate the latency of messages they send on
the Internet.
(C) Open standards and protocols allow users to freely share or reuse material found on the Internet for
noncommercial purposes.
(D) Open standards and protocols prevent developers from releasing software that contains errors.
• Khalil does better on the midterm exam than on the final exam, so his original midterm and
final exam scores are added to compute his total points.
• Josefina does better on the final exam than on the midterm exam, so her final exam score
replaces her midterm exam score in the total points calculation.
41. A programmer is writing a procedure to calculate a student’s final grade in the course using the score
replacement policy described. The student’s exam scores are stored in the variables midtermExam and
finalExam. The procedure Max (a, b) returns the larger of a and b.
Which of the following could be used in the procedure to calculate a student’s total points earned in the course and
store the result in the variable adjustedTotal?
43. An online retailer uses an algorithm to sort a list of n items by price. The table below shows the approximate
number of steps the algorithm takes to sort lists of different sizes.
45. A NAND gate is a type of logic gate that produces an output of false only when both of its two inputs
are true. Otherwise, the gate produces an output of true. Which of the following Boolean expressions
correctly models a NAND gate with inputs P and Q ?
(A) (NOT P) AND (NOT Q)
(B) (NOT P) AND Q
(C) NOT (P AND Q)
(D) NOT (P OR Q)
47. In public key cryptography, the sender uses the recipient’s public key to encrypt a message. Which of the
following is needed to decrypt the message?
(A) The sender’s public key
(B) The sender’s private key
(C) The recipient’s public key
(D) The recipient’s private key
Which of the following could replace <MISSING EXPRESSION> in line 2 so that the code segment works as
intended?
(A) end - start + 1
(B) end - start + 6
(C) ((end - start) / 5) + 1
(D) 5 * (end - start) + 1
Step Explanation
Shorten Takes a list of words and returns a new list that contains only the
first letter of each word from the input list
Keep Takes a list of words and returns a list that contains only the
palindromes palindromes from the input list
Sort Takes a list of words and returns a copy of the list in alphabetical
order
Executing which of the following sequences of steps will enable the algorithm to work as intended?
I. First shorten, then keep palindromes, then sort
II. First keep palindromes, then shorten, then sort
III. First sort, then keep palindromes, then shorten
(A) I only
(B) II only
(C) I and III
(D) II and III
53. Which of the following best describes the purpose of machine learning programs?
(A) To analyze large data sets, recognize patterns, and make predictions based on data
(B) To automatically translate algorithms from natural language to machine language
(C) To determine whether an algorithm can be constructed to answer “yes” or “no” for all possible inputs
(D) To find approximate solutions to problems that would otherwise require an unreasonably long amount of
time to solve
55. A student wrote the procedure below, which is intended to ask whether a user wants to keep playing a game.
The procedure does not work as intended.
PROCEDURE KeepPlaying ()
{
DISPLAY ("Do you want to continue playing (y/n)?")
response ← INPUT ()
IF ((response = "y") AND (response = "yes"))
{
RETURN (true)
}
ELSE
{
RETURN (false)
}
}
Which of the following best describes the result of running the procedure?
(A) The procedure returns true when the user inputs the value "y" and returns false otherwise.
(B) The procedure returns true when the user inputs the value "n" and returns false otherwise.
(C) The procedure returns true no matter what the input value is.
(D) The procedure returns false no matter what the input value is.
Which of the following expressions can be used to generate the string "Happy" ?
(A) Concat (Substring ("Harp", 1, 1), Substring ("Puppy", 2, 4))
(B) Concat (Substring ("Harp", 1, 2), Substring ("Puppy", 3, 3))
(C) Concat (Substring ("Harp", 1, 2), Substring ("Puppy", 4, 2))
(D) Concat (Substring ("Harp", 2, 2), Substring ("Puppy", 4, 2))
59. A media librarian at a movie studio is planning to save digital video files for archival purposes. The movie
studio would like to be able to access full-quality videos if they are needed for future projects. Which of the
following actions is LEAST likely to support the studio’s goal?
(A) Using video file formats that conform to published standards and are supported across many different
devices
(B) Using lossy compression software to reduce the size requirements of the data being stored
(C) Using storage media that can be expanded for additional data capacity
(D) Using a system that incorporates redundancy to handle disk failure
131. Which of the following are ways in which a programmer can use abstraction to manage the complexity of a program?
Select two answers.
Data format School Name, Last Name, First Name, Age, ZIP Code, Days Absent
Sample line of data East H.S., Ableson, Carlton, 16, 98987, 8
West High School stores the data in the following format.
Data format Student ID, First Name, Last Name, Age, Days Absent
Sample line of data 87667721, Kendra, Angelos, 14, 12
The two schools would like to combine their data to make a single data set. Which of the following can be done
with the combined data?
Select two answers.
(A) The schools can create a single list of student names, sorted by last name.
(B) The schools can determine the average number of days students are absent.
(C) The schools can determine which ZIP code is represented by the most students.
(D) The schools can determine the student ID of the student with the greatest number of absences.
133. A free online encyclopedia contains articles that can be written and edited by any user. Which of the following
are advantages the online encyclopedia has over a traditional paper-based encyclopedia?
Select two answers.
(A) The ability to easily check that the encyclopedia is free of copyrighted content
(B) The ability to ensure that encyclopedia content is the same every time it is accessed
(C) The ability to have a larger number of perspectives reflected in the encyclopedia content
(D) The ability to quickly update encyclopedia content as new information becomes available
(A) Line 1
(B) Line 4
(C) Line 7
(D) Line 9
135. Which of the following statements describe how cloud computing has affected Internet communication?
Select two answers.
(A) Cloud computing has eliminated the need to provide redundancy in Internet routing.
(B) Cloud computing has helped enhance collaboration.
(C) Cloud computing has introduced new data-security concerns.
(D) Cloud computing has reduced concerns about intellectual property rights.
STOP