APCSP 2018 practice exam MCQ test ACTUAL UPDATED QUESTIONS AND
CORRECT ANSWERS
B. second <- temp The code segment below is intended to swap the values of the variables first and
second using a temporary value, temp.
Which of the following can be used to replace missing code so that the code
segment works as intended?
temp <- first
first <- second
missing code
A. second <- first
B. second <- temp
C. temp <- first
D. temp <- second
B. calling the phone number given in the e-mail and A bank customer receives an e-mail from a sender claiming to be a bank
providing the personal information over the phone employee. The e-mail asks the customer to provide personal information and to
Because if it is phishing, then calling the phone number call a phone number if he/she has any questions. The customer suspects the e-
they give and giving your personal information is the mail might be a phishing attempt.
biggest privacy risk of all Which of the following responses is more 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
C. an experiment that requires data measurements to be Which of the following would be the best use of citizen science?
taken in many different locations A. an experiment that requires all participants to be working in the same
Because citizen science is the public participating in laboratory
science and an average citizen wouldn't be in a lab, have B. an experiment that requires expensive equipment to conduct
expensive equipment, or have certain training 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
A. a simulation of flipping a fair coin A student is writing a program to model different real-world events using
Because a Boolean variable is true or false (only two simulations. Which of the following simulations will generate a result that would be
options) best stored using a Boolean variable?
A. a simulation of flipping a fair coin
B. a simulation of rolling a fair dies (with sides numbered 1 through 6)
C. a simulation of the temperature in a location over time
D. a simulation of traffic patterns on a road
C. ticketPrice <- 12 The ticket prices at a movie theater are given below
, if(age <= 12 or age>= 60) Regular = 12
ticketPrice <- 9 Child (ages 12 and below) = 9
if (is3D) Senior (ages 60 and above) = 9
ticketPrice <- ticketPrice + 5 Plus 5 for 3D movies
Because this sets the price to be at 12, then if one of the A programmer is creating an algorithm to set the value of ticketPrice based on the
age conditions is met it lowers the price to 9. Then if the information above. Programmer used age variable for ages. The Boolean variable
movie is 3D, it adds 5 to the ticketPrice and makes that is3D is true when the movie is 3D and false otherwise.
the new ticketPrice Which of the following code segments correctly sets the value of ticketPrice?
A. ticketPrice <- 12
if(age <= 12 or age>= 60)
ticketPrice <- 9
if (is3D)
ticketPrice <- 17
B. ticketPrice <- 12
if(age <= 12 or age>= 60)
ticketPrice <- 9
else
ticketPrice <- 17
C. ticketPrice <- 12
if(age <= 12 or age>= 60)
ticketPrice <- 9
if (is3D)
ticketPrice <- ticketPrice + 5
D. ticketPrice <- 12
if(age <= 12 or age>= 60)
ticketPrice <- 9
else
ticketPrice <- ticketPrice + 5
A. Developing standards and protocols for Internet Which of the following best describes the role of the Internet Engineering Task
communication Force (IETF)?
Because the IETF's main role is to make the internet work A. Developing standards and protocols for Internet communication
better by developing, updating, and promoting voluntary, B. preventing copyrighted materials from being illegally distributed online
open, and high-quality technical standards C. preventing malicious software from being distributed online
D. Verifying the ownership of encrypted keys used in secured messages
C. 3 4 Consider the following program, which uses the variables start, end, and current.
Because start is 1, then becomes 3 and current is 3, then start <- 1
current (3) + 1 = 4 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
CORRECT ANSWERS
B. second <- temp The code segment below is intended to swap the values of the variables first and
second using a temporary value, temp.
Which of the following can be used to replace missing code so that the code
segment works as intended?
temp <- first
first <- second
missing code
A. second <- first
B. second <- temp
C. temp <- first
D. temp <- second
B. calling the phone number given in the e-mail and A bank customer receives an e-mail from a sender claiming to be a bank
providing the personal information over the phone employee. The e-mail asks the customer to provide personal information and to
Because if it is phishing, then calling the phone number call a phone number if he/she has any questions. The customer suspects the e-
they give and giving your personal information is the mail might be a phishing attempt.
biggest privacy risk of all Which of the following responses is more 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
C. an experiment that requires data measurements to be Which of the following would be the best use of citizen science?
taken in many different locations A. an experiment that requires all participants to be working in the same
Because citizen science is the public participating in laboratory
science and an average citizen wouldn't be in a lab, have B. an experiment that requires expensive equipment to conduct
expensive equipment, or have certain training 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
A. a simulation of flipping a fair coin A student is writing a program to model different real-world events using
Because a Boolean variable is true or false (only two simulations. Which of the following simulations will generate a result that would be
options) best stored using a Boolean variable?
A. a simulation of flipping a fair coin
B. a simulation of rolling a fair dies (with sides numbered 1 through 6)
C. a simulation of the temperature in a location over time
D. a simulation of traffic patterns on a road
C. ticketPrice <- 12 The ticket prices at a movie theater are given below
, if(age <= 12 or age>= 60) Regular = 12
ticketPrice <- 9 Child (ages 12 and below) = 9
if (is3D) Senior (ages 60 and above) = 9
ticketPrice <- ticketPrice + 5 Plus 5 for 3D movies
Because this sets the price to be at 12, then if one of the A programmer is creating an algorithm to set the value of ticketPrice based on the
age conditions is met it lowers the price to 9. Then if the information above. Programmer used age variable for ages. The Boolean variable
movie is 3D, it adds 5 to the ticketPrice and makes that is3D is true when the movie is 3D and false otherwise.
the new ticketPrice Which of the following code segments correctly sets the value of ticketPrice?
A. ticketPrice <- 12
if(age <= 12 or age>= 60)
ticketPrice <- 9
if (is3D)
ticketPrice <- 17
B. ticketPrice <- 12
if(age <= 12 or age>= 60)
ticketPrice <- 9
else
ticketPrice <- 17
C. ticketPrice <- 12
if(age <= 12 or age>= 60)
ticketPrice <- 9
if (is3D)
ticketPrice <- ticketPrice + 5
D. ticketPrice <- 12
if(age <= 12 or age>= 60)
ticketPrice <- 9
else
ticketPrice <- ticketPrice + 5
A. Developing standards and protocols for Internet Which of the following best describes the role of the Internet Engineering Task
communication Force (IETF)?
Because the IETF's main role is to make the internet work A. Developing standards and protocols for Internet communication
better by developing, updating, and promoting voluntary, B. preventing copyrighted materials from being illegally distributed online
open, and high-quality technical standards C. preventing malicious software from being distributed online
D. Verifying the ownership of encrypted keys used in secured messages
C. 3 4 Consider the following program, which uses the variables start, end, and current.
Because start is 1, then becomes 3 and current is 3, then start <- 1
current (3) + 1 = 4 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