Font size
WorksheetsAP Computer Science Principles Practice Exam
Total questions: 40
Worksheet time: 38mins
Which of the following is LEAST likely to indicate a phishing attack?
An e-mail from your bank asks you to call the number on your card to verify a transaction
An e-mail from a merchant asks that you click on a link to reset your password
An e-mail from a utility company asks you to enter your date of birth and social security number for verification purposes
An e-mail indicates that you have won a large sum of money and asks you to enter your bank account number so that the money can be transferred to you
Which of the following activities poses the greatest personal cybersecurity risk?
Making a purchase at an online store that uses public key encryption to transmit credit card information
Paying a bill using a secure electronic payment system
Reserving a hotel room by e-mailing a credit card number to a hotel
Withdrawing money from a bank account using an automated teller machine (ATM)
Which of the following best describes a Distributed Denial of Service (DDoS) attack?
An attempt by a country to deny its citizens access to the Internet
An attempt to deny users access to a Web site's resources by flooding the Web site with requests from multiple systems
An attempt by one user to deny service to another user by posting material on a social network
An attempt by a user of the Internet to get private information from a secure database
A program is expressed in a programming language. Which of the following is true of the program?
The program can also be expressed as binary code, but will be more easily understood by humans when expressed in a higher-level programming language.
The program can also be expressed as binary code, which will reduce the likelihood of errors.
The program cannot be expressed as binary code, because binary code can only be used to represent data.
Some parts of the program can be expressed as binary code, but operations must be expressed using a higher-level programming language.
Which of the following statements best describes the properties of public key encryption?
Public key encryption is an encryption method which relies on separate keys for encrypting and decrypting information.
Public key encryption is a highly secure encryption scheme that in which a single key is used by both the sender and receiver of the message.
Public key encryption makes use of certain types of problems which are easier for humans to solve than computers.
Public key encryption makes use of mathematical problems which no algorithm can be used to solve.
A flowchart is a way to visually represent an algorithm. The flowchart above uses the building blocks from the table above.
Which of the following statements best describes the behavior of the algorithm depicted in the flowchart?
Assume a always starts greater than b.
It displays the sum of a and b.
It displays the difference between a and b.
It displays the product of a and b
It runs in an infinite loop.
Consider the process of encoding and decoding a message using the following Caesar cipher encoding scheme in which the plaintext and ciphertext alphabets are offset by four positions, as shown above.
Which of the following encoded ciphertext strings decodes to an original plaintext message of “secret”?
ersecr
wigvix
kwujwl
oaynap
Which of the following best defines confidentiality in context with information and data?
The ability to limit access to information to a certain set of users
The certainty that information is accurate
The confirmation that a company will not sell your information to others
The reliability of access to information
Which of the following is true about low level computer languages?
I. Low level languages give the programmer more control over how system resources are used.
II. Code in a programming language is often translated into code in another (lower level) language to be executed on a computer.
III. Low level programming languages are designed to be easier for people to read and write.
II only
I and III only
I and II only
ii and III only
A large office building has an elevator that carries occupants between any of the building's 10 floors. The basement is referred to as "Level 0" while the topmost floor is "Level 9." The software for the elevator uses a variable, called level, to track the floor number of the elevator's current position. When a person presses a button requesting the elevator to rise to a higher floor, the above code is executed.
What is displayed if the elevator is currently on the 7th floor (level = 7) and the person on the elevator presses a button that says to go up 3 floors (floors = 3)?
Level 7 Level 8 Level 9
Level 8 Level 9 Cannot go up. Level 9
Level 8 Level 9 Level 10
Cannot go up.
Consider the above code segments designed to find the area of a triangle (A = 1/2 bh).
Which of the following statements about the above programs is true?
Both programs will work as intended, but Program B is more readable.
Program A will work as intended, but Program B will not work as intended.
Program B will work as intended, but Program A will not work as intended.
Neither program will work as intended.
Given the above code segment, what would be displayed if age were initialized with a value of 18?
group 1
group 2
group 1 group 2
Nothing will be displayed
Which of the following would be the most appropriate name for a variable?
variable1
t
amountOfTimeRemainingInTheGame
time_left
While developing a program, you find a similar project that someone has created and posted online. It contains a number of elements (e.g., images, music, code segments, etc.) that you would like to integrate into your own project. Under what conditions may you reuse these elements in your work?
You may never reuse someone else’s work.
You may reuse any elements that are posted publicly online as long as credit is given to their creator.
You may only reuse elements for which the original owner has granted a license to reuse, such as the Creative Commons Share Alike license.
You may always reuse anything that is posted publicly or privately online.
Consider the above code.
Assuming that before this code is run, x = 1. What would be displayed at the end?
210
16
8
1
What condition will make the above an infinite loop?
y = -108
y≠-3
y ≥ 8
y < -53
Consider the above code segment.
Which of the following best describes the result of running the code segment?
The number 0 is displayed.
The number 4 is displayed.
The number 10 is displayed.
Nothing is displayed; the program results in an infinite loop.
The volume of a rectangular prism is calculated by multiplying its length, width and height. What could be substituted into the section of the code marked < missing code > that would accurately calculate the volume based on the user input of l, w and h?
l x w x h
l * w * h
l(w)(h)
l / w / h
ASCII is a character-encoding scheme that uses a numeric value to represent each character. For example, the uppercase letter “G” is represented by the decimal (base 10) value 71. A partial list of characters and their corresponding ASCII values are shown in the table above.
ASCII characters can also be represented by binary numbers. According to ASCII character encoding, which of the following letters is represented by the binary (base 2) number 1010100?
N
P
T
W
Which of the following decimal (base-10) values is equivalent to the binary (base-2) value 101001?
22
37
41
82
What value does the above code segment display?
17
36
53
No value is ever displayed because the algorithm repeats the REPEAT UNTIL block indefinitely.
As of 2016, the selling of used digital media is illegal. Along with selling it, there are many other illegal uses of digital media. Which of the following would be a legal use of digital media?
You download an app on your smartphone that allows you to ‘strip’ the audio from any YouTube music video and permanently keep that audio in your music collection.
You make an MP3 copy of a song because the CD you bought expressly permits you to do so, and then you put your MP3 copy on the Internet, using a file-sharing network, so that millions of other people can download it.
You have a computer with a CD burner, which you use to burn copies of music you have downloaded onto writable CDs for all of your friends.
You download a song from iTunes and sync it to the cloud so that it is accessible on all of your devices.
The above procedure check is called in a program after each time a True or False question is answered. If the user types in True True False True as their answers for four questions on a quiz, what should their overall score be?
25%
50%
75%
100%
ASCII is a character-encoding scheme that uses 7 bits (8 bits if you are using the extended ASCII table) to represent each character. The decimal (base 10) values 65 through 90 represent the capital letters A through Z, as shown in the table above.
Which ASCII character is represented by the binary (base 2) number 1000001?
A
B
C
D
Which of the following is an advantage that text-based programming languages (e.g., Processing) have over block-based programming languages (e.g., Scratch)?
Text-based programming languages allow programmers to write programs in English and other natural languages.
Text-based programming languages do not require the programmer to worry about syntax, capitalization, or punctuation.
Programs written in text-based programming languages do not require debugging.
Text-based programming languages offer programmers more detailed control over lower-level functionality when writing a program.
Consider the above procedure. Which of the following best describes the behavior of the find procedure?
Displays the position of the first occurrence of target in list
Displays the positions of all occurrences of target in list
Displays the position of the last occurrence of target in list
Displays each item in list that is equal to target
In order to be inducted into a school’s National Honor Society (NHS), they must meet certain criteria for their GPA, serviceHours and grade. The expression below indicates whether a student has been accepted as a member of the NHS.
(GPA = 3.65) AND (serviceHours = 30) AND (NOT grade = 9)
Which of the following values would indicate a student that would be accepted into NHS?
GPA = 3.85, serviceHours = 45, grade = 9
GPA = 3.50, serviceHours = 100, grade = 10
GPA = 4.00, serviceHours = 15, grade = 11
GPA = 3.65, serviceHours = 30, grade = 12
Which of the following is true about program documentation?
Program documentation is only needed for programs in development; it is not needed after a program is completed.
Program documentation is useful when programmers collaborate but not when a programmer works individually on a project.
Program documentation is useful during initial program development and also when modifications are made to existing programs.
Program documentation should not be changed after it is first written.
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?
The song was saved using fewer bits per second than the original song.
The song was saved using more bits per second than the original song.
The song was saved using a lossless compression technique.
Some information is lost every time a file is saved from one location on a computer to another location.
Which of the following are benefits of using well-named variables in a computer program?
Select two answers.
The program will run faster.
The program will be easier for people to read.
The program will have a greater data storage capacity.
The program will be easier to modify in the future.
What is an Event?
An action that causes something to happen
An action that doesn’t do anything in the App
An action that will allow you to look up and event
Something that is happening in the calendar
What is the User Interface
Elements of which the user controls
Elements of which the coder controls
An interface with code
An interface with options
If you think your computer has a virus, a good first step in solving the problem would be to:
Run a virus scan
Reformat the hard drive
Destroy the computer
Do nothing
Antivirus software is designed to protect computers from an assortment of viruses and unauthorized intrusions
True
False
