wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

AP CSP Exam Review

Total questions: 27

Worksheet time: 47mins

Name
Class
Date
1.

What does it mean when we say the Internet is redundant?

a)

Parts of it are unnecessary

b)

If a path is down, packets can be routed a different way

c)

It has a delay between the request and the response to the request

d)

If there is an error, a backup system is brought online to be used

2.

What are packets when referring to the Internet?

a)

The delay in time from when a request is sent and received

b)

The individual sections of the IP address

c)

Information to be sent over the Internet broken into same size groupings

d)

The intermediate locations that send information to their destination

3.

What describes the process of keeping common or similar features and functionality while removing details that are different?

a)

An alorithm

b)

Decomposition

c)

Simulation

d)

Abstraction

4.

How are algorithms and programs related?

a)

They have a hierarchical relationship

b)

Programs implement algorithms

c)

Algorithms implement programs

d)

They can both be run on a computer

5.

What is a benefit of collaboration when writing code?

a)

Collaboration allows the work to be divided among independent programmers to create.

b)

Collaboration makes it easier to document another person's code

c)

Collaboration makes it eastier to find errors

d)

Collaboration produces an increase in user requirements that can be met with more team members.

6.
What type of variable is "help"?
a)
Integer
b)
Float
c)
String
d)
List
7.
A photographer is manipulating a digital image and overwriting the original image. Which of the following describes a lossy transformation of the digital image?
a)
Creating the gray scale of an image by averaging the amounts of red, green, and blue in each pixel and assigning this new value to the corresponding pixel in the new image. The new value of each pixel represents a shade of gray, ranging from white to black.
b)
Creating a mirrored image by swapping the RGB values from pixels on the left side of an image with RGB values from pixels on the right side of an image.
c)
Swapping the Red and Green values of each pixel so that areas that were red now appear green and vice versa.
d)
Creating the negative of an image by creating a new RGB triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed.
8.
Which of the following statements are true about lossless compression?
I - Lossless compression is used only to send files over the Internet
II - Sending a compressed version of a file ensures that the contents of the file cannot be intercepted by an unauthorized user.
a)
I only
b)
II only
c)
I and II
d)
Neither I nor II
9.
A red triangle is pictured below in a grid of squares. It is currently facing upward, and can only move using the MoveTriangle procedure, shown below. The triangle can move onto white and gray squares, but not onto the black squares.
PROCEDURE MoveTriangle (numMoves, numTurns)
{ 
REPEAT
numMoves TIMES   

MOVE_FORWARD() 
}
 
REPEAT numTurns TIMES 
{   
TURN_RIGHT() 
}
}
Which of the following instructions will get the red triangle to the gray square?
a)
 
MoveTriangle (1, 1) MoveTriangle (1, 1) MoveTriangle (3, 1) MoveTriangle (3, 0)
b)
MoveTriangle (4, 1)
MoveTriangle (4, 0)
c)
MoveTriangle (1, 1)
MoveTriangle (1, 3)
MoveTriangle (3, 1)
MoveTriangle (3, 0)
 
d)
MoveTriangle (1, 1)
MoveTriangle (1, 3)
MoveTriangle (3, 3)
MoveTriangle (3, 0)
10.
Efficiency of algorithms is most often analyzed based on which of the following characteristics?
a)
The number of lines of computer code needed to implement the algorithm.
b)
The time and memory space necessary to run the algorithm.
c)
How easy or difficult the algorithm is to understand.
d)
The size of the output obtained after running the algorithm.
11.
Which of the following statements about abstraction is true?
a)
Abstraction requires users to understand the low-level details of a system.
b)
Abstraction reduces information and detail to facilitate focus on relevant concepts.
c)
Abstraction increases the run-time complexity of a program.
d)
Abstraction compresses a program file to reduce file size.
12.
A programmer is writing code to switch the values of two integer variables, namely a and b, using a temporary integer variable, temp. Will the pseudo-code correctly perform the required task (assume that a and b are never numerically equal)?
This is the pseudo-code that the programmer has come up with:
temp ← a  # statement 1.
b ← temp  # statement 2.
a ← b  # statement 3.
a)
Yes, the code correctly switches the values of 'a' and 'b'.
b)
No, but it will work correctly if statements 1. and 3. are switched.
c)
No, but it will work correctly if statements 2. and 3. are switched.
d)
No, but it will work correctly if statements 1. and 2. are switched.
13.
Trace the value of an integer variable n in the following code.
i ← 1
n ← 2
REPEAT until i = 4
{
  n ← n * 2
  i ← i + 1
}
  What is n?
a)
4
b)
8
c)
16
d)
32
14.
A piece of code that you can easily call over and over again. 
a)
Repeat
b)
Functions
c)
Procedures
d)
Fractions
15.

Why is it important to focus on programming style in addition to programming functionality?


I) Program style helps others understand your program and maintain it


II) Programming style only applies to certain programming languages


III) Programming style increases the reusability of your code

a)

Only I

b)

I and II

c)

I and III

d)

II and III

16.

Which of the following activities poses the LEAST potential cybersecurity risk?

a)

Clicking on a link in an email from an unknown sender

b)

Sharing your device’s private key used for encryption

c)

Sharing your device’s public key used for encryption

d)

Using a credit card to make an online purchase on a website that does not use encryption

17.

Suppose we used an Internet Addressing protocol that used 8 bits to encode a single address. With this protocol, how many devices would be able to have their own unique address?

a)

64

b)

256

c)

16

d)

128

18.

How many times will this loop run?


for i in range (1, 4):

a)

4

b)

1

c)

2

d)

3

19.

Which one of the following statements about functions is TRUE

a)

A function can change names over the course of a program.

b)

Code can be added or removed dynamically from a function while the program is running.

c)

Functions can be called using different names depending on where in the program they are called.

d)

Two functions can be given identical names as long as their code is identical.

e)

Two functions in a single program can have different names but contain identical code.

20.

A blogging Website allows users to post messages and to comment on other messages that have been posted. When a user posts a message, the message itself is considered data. In addition to the data, the site stores the following metadata.


The time the message was posted;

The name of the user who posted the message;

The names of any users who comment on the message and the times the comments were made;

Which of the following questions could NOT be answered using only the data and metadata collected?

a)

Which users post messages most frequently?

b)

What time of day is the site most active?

c)

Which posts from a particular user have received the greatest number of comments?

d)

In what country is the site most active?

21.

An artist makes an RGB raster image in which each pixel color is encoded with 12-bits --- 4 bits each for red, green and blue.Which of the following correctly shows the hexadecimal value for Red as a 12-bit representation.

a)

F00

b)

00F

c)

FF00

d)

FF0000

22.

Which of the following is irreversible?

a)

lossy compression

b)

lossless compression

c)

abstraction

d)

RLI

23.

How would you lighten the color #bcc8e1?

a)

+50 to each color component

b)

+50 to the red component

c)

-50 to each color component

d)

-50 to the red component

24.

Which of the following statements is FALSE?

a)

The computer stores colors in hexadecimal

b)

Every color has 3 components. A red, green and a blue component.

c)

A bright color would be represented by a large number.

d)

A computer uses 3 bytes to store a single colored pixel.

25.

Consider the following three binary numbers:

01010

010000

1110

Which of the following lists the numbers in order from least to greatest?

a)

010000

1110

01010


b)

01010

1110

010000


c)

01010

010000

1110


d)

1110

01010

010000


26.
What does Protocol mean?
a)
Security
b)
Rules
c)
Orders
d)
Services
27.
This is used to resolve host names to IP addresses
a)
IP address
b)
subnet mask
c)
default gateway
d)
DNS server