Font size
WorksheetsAP CS P 5.1
Total questions: 50
Worksheet time: 25mins
You won the lottery and elected to receive a lump sum! The largest number the bank’s computer can store is 231−1 , or 2,147,483,647. After depositing your lottery winnings of $2,500,000,000.00, what will the result be?
Your winnings were more than the largest number the bank’s computers could hold, so an overflow error will occur.
Since decimal numbers are stored imprecisely in computers, a rounding error will occur.
The amount will be represented in machine code format, so converting it to decimal will show the balance in a more readable format.
The amount will cause a runtime error.
You stop by and purchase your favorite snack after school one day. You notice the cash register shows the change you are owed as: 0.04999999 rather than 0.05. How is this possible?
The cash register DISPLAY procedure has an error.
A rounding error occurred.
It’s displaying the change owed in a different currency.
The amount is represented as a string field rather than a number.
You are assigned a parking space in a large parking lot by an automated machine. You recognize that the parking space number is displayed in binary, but the parking spots are labeled in decimal numbers. Convert the parking space number 10011011 to decimal to know where to park and avoid getting towed.
154
155
157
9F
When designing a web page, you see a color you want to use listed in binary as: 01010000, 11001000, 01111000. Which color is it, given the decimal equivalents (Red, Green, Blue)?
(32, 76, 414)
(50, 118, 78)
(80, 200, 120)
(128, 310, 170)
Your bank asks for your phone number to associate it with your account. What is this an example of?
A privacy concern
Multifactor authentication
A phishing attempt
Asymmetric authentication
You have to change a program written a year ago by someone else. A sample section of code is below. How could the original program author have helped anyone making changes at a later date? PROCEDURE A (x, y, z) IF x < y { x <- z }
Provided the original program requirements
Added a video describing the program design and functionality
Used procedure and variable names that described their purpose and content
Which statement is NOT true?
Lower level languages are easier to debug because the language is closest to what the computer executes.
Higher level languages are easier to debug because the language is closer to natural language.
Lower level languages provide less abstraction.
Higher level languages are easier for people to code in because they are more abstract.
A simulation of conditions for a new sensor to be used with self-driving cars is being designed. The pseudocode for the test is below.
When car starts, turn sensor on and set incident_counter to 0 When detect object 3 feet or closer, redirect steering wheel away from object Add one to incident_counter
Which condition is not a useful simulation test for the sensor?
Multiple obstacles at the same time.
Zero incidents.
Set up objects at 3 feet, less than 3 feet, and greater than 3 feet to determine the action taken.
If the car causes an accident, by swerving.
Which of the following will evaluate to "true"?
i. (true AND true) OR (true AND false)
ii. NOT(true OR false)
iii. NOT(false) AND NOT(true AND false)
i and ii
i and iii
ii and iii
i, ii, and iii
What outcome will the Boolean conditions in the diagram produce at steps 1, 2, and 3?
(C) 1—False, 2—True, 3—True
(A) 1—True, 2—True, 3—False
(B) 1—False, 2—False, 3—True
(D) 1—True, 2—False, 3—False
Susie’s mother wants a copy of a photo from a family vacation that Susie took. The picture is too large to e-mail. How should Susie compress the image if her mother wants to print a large copy of it suitable for framing?
She should use a lossless compression technique, which will be needed to print a version with high enough quality to frame.
She should use a lossy compression technique to obtain enough compression to send the image.
They should be combined for the best compression technique.
Any compression technique will be sufficient in this case.
What describes the process of searching datasets for incomplete data records to process?
Classifying
Cleaning
Clustering
Filtering
Given the table of data about car accidents, which outcome is supported by the data?
Drivers ages 16–25 have the fewest accidents.
More accidents occur on the weekdays.
Drivers age 26–50 have fewer accidents than the other two age groups.
Adult drivers have more accidents on weekdays during rush hour.
Why do businesses and scientists attempt to analyze large datasets?
To gain insights smaller subsets of data may not provide
To confirm findings from smaller datasets
To identify potential problems in the metadata
To obtain economies of scale with hardware needed to store the data
How do the World Wide Web and the Internet work together?
They perform the same functionality.
The Web uses HTTP to share computational artifacts using the Internet.
The Internet uses the Web to connect devices to share data.
The Internet has the “deep” net and “dark” net but the Web does not.
If a fire occurs at a major Internet hub, what is the result?
Internet traffic will be routed to its destination in a different way because of the redundancy built into the Internet.
The part of the globe that is served by that Internet hub will be down because of the end-to-end architecture of the Internet.
Different IP addresses will be assigned to devices that were impacted by the unavailability of the Internet hub.
People can use dedicated phone lines as a backup with no change in service.
The time it took to complete a task sequentially was 25 seconds. The time it took to complete the same task using a parallel computing model was 10 seconds. What is the speedup?
2.5
0.4
15
-15
If a company is trying to determine whether to upgrade its bandwidth based on the following graph, what should they measure?
Amount of data uploaded as it includes strategic company backup data
Amount of data downloaded as it has the largest impact on the bandwidth
Frequency of the peak times
Number of devices used on the network
You notice a file being uploaded every night to a site you are not familiar with. Opening the file, it looks like a file of your work from the day. This could be an example of a:
computer virus
keylogger file
network worm
phishing attack
You are part of a team that created facial recognition software. However, you just learned an innocent person was taken into custody using only facial recognition software. What can the team do to remove any bias in the future?
Create better training materials for interpreting the results
Use photos of a more diverse population to train the algorithm for recognition
Contact lawmakers to support regulation of the use of facial recognition software
Add new members to the team to increase the diversity to better identify and avoid bias
You make a compressed version of an old classic song to send to a friend. You notice that the sound quality is not as sharp as your version. What is the likely cause?
The file was compressed with a lossy algorithm.
The file was compressed with a lossless algorithm.
The file was corrupted during the copying process.
The file was copied from a digital version rather than the original analog version.
Which of the following is true about packets?
The receiving device acknowledges the first and last packets to indicate receipt of the data stream.
Packets travel in order to their destination.
Packets follow the shortest path to their destination.
Packets are reassembled at their final destination.
How do TCP and IP interact?
IP forwards the data to the ISP to identify which TCP to use.
TCP hands off control to HTTP, which passes it to IP.
TCP creates packets from the data to be sent and transfers control to IP for routing. TCP then reassembles the packets at the destination.
IP uses UDP in conjunction with TCP to securely send data.
An e-mail goes out from your organization's payroll department to all employees stating that everyone needs to confirm or update their banking information to ensure paychecks are deposited on time. It turns out this was not an e-mail from the payroll department. It is most likely a:
computer virus
keylogger attack
phishing attack
malware insertion point
You need to share a confidential file with another organization. You know the file needs to be encrypted to prevent unauthorized access to its contents. What is the best method of encryption to use?
Certificate Authorities (CAs) to validate the security of the organization where you are sending the data
Multifactor authentication to ensure multiple steps of security
Public key encryption so you do not have to share the encryption key
Symmetric key encryption so you each have the encryption and decryption keys
What is a benefit of the government posting databases for public use?
It is a way to identify the need for new policies and regulations.
Consumers can learn more about how their individual data is being collected, stored, and used.
Companies can opt out to prevent competitors from learning about their business.
All businesses can access the data at no cost, aiding those businesses that would otherwise not have the resources to obtain the data on their own.
Which algorithm will display the smallest number in a list of positive numbers? Assume max is a variable holding the largest number in the list.
smallest ← -1
FOR EACH num IN list {
IF (smallest < num) { smallest ← num
}
}
DISPLAY (smallest)
smallest ← list[i]
FOR Each num IN list {
IF (smallest > num) { smallest← num }
} DISPLAY (smallest
)
smallest← -1
FOR EACH num IN list {
IF (smallest > num) { num ← smallest }
}
DISPLAY (smallest)
smallest ← max
FOR EACH num IN list {
IF (smallest > num) {
smallest ← num }
} DISPLAY (smallest)
Which of these is a Boolean expression?
X ← 57
Y ← temp * 120 / 100
(temp > 32)
72 + 12 - (12 * 6) -> z
What can be determined from the following program flow?
Intro()
Rules()
Play()
Score()
DISPLAY (HighScore())
A game is played by calling different procedures.
An error will occur due to invalid procedure names.
Parameters are missing from the procedures resulting in a runtime error.
A compile time error occurs due to Score() and HighScore().
Which statement’s format is incorrect?
IF (NOT (x > y)) { DISPLAY(message) }
x ← x + y
list[i] ← list[j]
ELSE DISPLAY(new message)
Which algorithm should be used to find a phone number on a contact list?
I. Sort the contact list by name Search for the phone number using a binary search Display the correct phone number
II. Search for the phone number using a linear search Display the correct phone number
I and II are equally effective.
A combination of both I and II should be used.
Why does a computer playing chess use a heuristic algorithm?
It ensures the computer only wins a certain number of times making it a more enjoyable experience for people.
It ensures humans only win a certain percentage based on statistics.
It takes too long to analyze all possible moves, so the computer takes the next best move.
It checks each possible combination of moves for the best move.
You are determining the attributes for an AI (Artificial Intelligence) algorithm for a bank to use for approving customers for loans. You select age, income, employment status, and active-loan status as attributes to consider. The bank finds that very few new loans are being offered to college-educated individuals due to college loans. This is an example of bias in:
analyzing the data
collecting the data
preparing the data
reporting the data
If a list named snacks contains the values:
snacks ← ["chocolate", "peanuts", "granola", "chips", "grapes"]
A variable place is assigned the value:
place ← LENGTH(snacks)
What will the value snacks[place] contain?
5, the number of items in the list.
6, the number of letters in the word "grapes."
grapes, which is the value in the 5th position of the list.
Error, a list cannot be accessed in this way.
Will both of the following two blocks produce correct results? Assume all variables have been properly initialized.
Only Block 1 is correct.
Only Block 2 is correct.
Both blocks are correct.
Neither block is correct.
What State Is Los Angeles In
Texas
New York
North Carolina
California
Utah
Which Countries Are Not In Europe
France
Germany
Thailand
China
Italy
What Is The Capital Of Canada
Washington DC
Ottawa
Mexico City
Which Country Is In The Nordic Region
United Kingdom
Norway
Grenada
Cuba
Mongolia
Which Countries Belong To Denmark
China
Faroe Islands
Fiji
Aland Islands
Greenland
What did Cinderella forget at the ball?
A shoe
Mice
Keys to her house
Dust-Pan
Who is the villain in the movie 'Sleeping Beauty'?
Maleficent
Ursula
Aurora
Cinderella
Which Disney princess is friends with a talking teapot and candlestick?
Cinderella
Ariel
Snow White
Belle
What country is in red?
Germany
France
Spain
Italy
Russia
Armenia
Thailand
Kenia
Egypt
Australia
North Korea
Nepal
