wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AP Computer Science Principles Practice Exam

Total questions: 40

Worksheet time: 38mins

Name
Class
Date
1.

Which of the following is LEAST likely to indicate a phishing attack?

a)

An e-mail from your bank asks you to call the number on your card to verify a transaction

b)

An e-mail from a merchant asks that you click on a link to reset your password

c)

An e-mail from a utility company asks you to enter your date of birth and social security number for verification purposes

d)

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

2.

Which of the following activities poses the greatest personal cybersecurity risk?

a)

Making a purchase at an online store that uses public key encryption to transmit credit card information

b)

Paying a bill using a secure electronic payment system

c)

Reserving a hotel room by e-mailing a credit card number to a hotel

d)

Withdrawing money from a bank account using an automated teller machine (ATM)

3.

Which of the following best describes a Distributed Denial of Service (DDoS) attack?

a)

An attempt by a country to deny its citizens access to the Internet

b)

An attempt to deny users access to a Web site's resources by flooding the Web site with requests from multiple systems

c)

An attempt by one user to deny service to another user by posting material on a social network

d)

An attempt by a user of the Internet to get private information from a secure database

4.

A program is expressed in a programming language. Which of the following is true of the program?

a)

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.

b)

The program can also be expressed as binary code, which will reduce the likelihood of errors.

c)

The program cannot be expressed as binary code, because binary code can only be used to represent data.

d)

Some parts of the program can be expressed as binary code, but operations must be expressed using a higher-level programming language.

5.

Which of the following statements best describes the properties of public key encryption?

a)

Public key encryption is an encryption method which relies on separate keys for encrypting and decrypting information.

b)

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.

c)

Public key encryption makes use of certain types of problems which are easier for humans to solve than computers.

d)

Public key encryption makes use of mathematical problems which no algorithm can be used to solve.

6.

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.

a)

It displays the sum of a and b.

b)

It displays the difference between a and b.

c)

It displays the product of a and b

d)

It runs in an infinite loop.

7.

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”?

a)

ersecr

b)

wigvix

c)

kwujwl

d)

oaynap

8.

Which of the following best defines confidentiality in context with information and data?

a)

The ability to limit access to information to a certain set of users

b)

The certainty that information is accurate

c)

The confirmation that a company will not sell your information to others

d)

The reliability of access to information

9.

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.

a)

II only

b)

I and III only

c)

I and II only

d)

ii and III only

10.

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)?

a)

Level 7 Level 8 Level 9

b)

Level 8 Level 9 Cannot go up. Level 9

c)

Level 8 Level 9 Level 10

d)

Cannot go up.

11.

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?

a)

Both programs will work as intended, but Program B is more readable.

b)

Program A will work as intended, but Program B will not work as intended.

c)

Program B will work as intended, but Program A will not work as intended.

d)

Neither program will work as intended.

12.

Given the above code segment, what would be displayed if age were initialized with a value of 18?

a)

group 1

b)

group 2

c)

group 1 group 2

d)

Nothing will be displayed

13.

Which of the following would be the most appropriate name for a variable?

a)

variable1

b)

t

c)

amountOfTimeRemainingInTheGame

d)

time_left

14.

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?

a)

You may never reuse someone else’s work.

b)

You may reuse any elements that are posted publicly online as long as credit is given to their creator.

c)

You may only reuse elements for which the original owner has granted a license to reuse, such as the Creative Commons Share Alike license.

d)

You may always reuse anything that is posted publicly or privately online.

15.

Consider the above code.


Assuming that before this code is run, x = 1. What would be displayed at the end?

a)

210

b)

16

c)

8

d)

1

16.

What condition will make the above an infinite loop?

a)

y = -108

b)

y≠-3

c)

y ≥ 8

d)

y < -53

17.

Consider the above code segment.


Which of the following best describes the result of running the code segment?

a)

The number 0 is displayed.

b)

The number 4 is displayed.

c)

The number 10 is displayed.

d)

Nothing is displayed; the program results in an infinite loop.

18.

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?

a)

l x w x h

b)

l * w * h

c)

l(w)(h)

d)

l / w / h

19.

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?

a)

N

b)

P

c)

T

d)

W

20.

Which of the following decimal (base-10) values is equivalent to the binary (base-2) value 101001?

a)

22

b)

37

c)

41

d)

82

21.

What value does the above code segment display?

a)

17

b)

36

c)

53

d)

No value is ever displayed because the algorithm repeats the REPEAT UNTIL block indefinitely.

22.

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?

a)

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.

b)

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.

c)

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.

d)

You download a song from iTunes and sync it to the cloud so that it is accessible on all of your devices.

23.

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?

a)

25%

b)

50%

c)

75%

d)

100%

24.

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)

A

b)

B

c)

C

d)

D

25.

Which of the following is an advantage that text-based programming languages (e.g., Processing) have over block-based programming languages (e.g., Scratch)?

a)

Text-based programming languages allow programmers to write programs in English and other natural languages.

b)

Text-based programming languages do not require the programmer to worry about syntax, capitalization, or punctuation.

c)

Programs written in text-based programming languages do not require debugging.

d)

Text-based programming languages offer programmers more detailed control over lower-level functionality when writing a program.

26.

Consider the above procedure. Which of the following best describes the behavior of the find procedure?

a)

Displays the position of the first occurrence of target in list

b)

Displays the positions of all occurrences of target in list

c)

Displays the position of the last occurrence of target in list

d)

Displays each item in list that is equal to target

27.

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?

a)

GPA = 3.85, serviceHours = 45, grade = 9

b)

GPA = 3.50, serviceHours = 100, grade = 10

c)

GPA = 4.00, serviceHours = 15, grade = 11

d)

GPA = 3.65, serviceHours = 30, grade = 12

28.

Which of the following is true about program documentation?

a)

Program documentation is only needed for programs in development; it is not needed after a program is completed.

b)

Program documentation is useful when programmers collaborate but not when a programmer works individually on a project.

c)

Program documentation is useful during initial program development and also when modifications are made to existing programs.

d)

Program documentation should not be changed after it is first written.

29.

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?

a)

The song was saved using fewer bits per second than the original song.

b)

The song was saved using more bits per second than the original song.

c)

The song was saved using a lossless compression technique.

d)

Some information is lost every time a file is saved from one location on a computer to another location.

30.

Which of the following are benefits of using well-named variables in a computer program?

Select two answers.

a)

The program will run faster.

b)

The program will be easier for people to read.

c)

The program will have a greater data storage capacity.

d)

The program will be easier to modify in the future.

31.
Working together to facilitate the application of multiple perspectives and diverse talents and skills is the definition of
a)
visualtion
b)
collaboration
c)
ReCAPTCHA
d)
crowdsourcing
e)
extraction
32.
Large amounts of structured and unstructured data that can potentially be mined, examined, and used by organizations is the definition of
a)
usable data
b)
data set
c)
usable data
d)
big data
e)
data collection
33.
The representation of information using a chart, diagram, image, etc. is the definition of
a)
indexing
b)
analytics
c)
extraction
d)
concatenation
e)
visualization(s)
34.
Chaining together or placing two or more separate things side by side so that they are treated as one is the definition of
a)
concatenation
b)
ReCAPTCHA
c)
indexing
d)
extraction
e)
cache
35.
A memory location to store active data temporarily to shorten data access times and reduce latency is the definition of
a)
analytics
b)
utility
c)
indexing
d)
cache
e)
big data
36.
A collection of numbers or values that relate to a particular subject usually portrayed in a relational database table.  Example: column header and row contents for test scores for each student. This is the definition of
a)
data set
b)
useful data
c)
usable data
d)
structured data
e)
data persistence
37.

What is an Event?

a)

An action that causes something to happen

b)

An action that doesn’t do anything in the App

c)

An action that will allow you to look up and event

d)

Something that is happening in the calendar

38.

What is the User Interface

a)

Elements of which the user controls

b)

Elements of which the coder controls

c)

An interface with code

d)

An interface with options

39.

If you think your computer has a virus, a good first step in solving the problem would be to:


a)

Run a virus scan

b)

Reformat the hard drive

c)

Destroy the computer

d)

Do nothing

40.

Antivirus software is designed to protect computers from an assortment of viruses and unauthorized intrusions

a)

True

b)

False