wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

AP CSP Programming Test

Total questions: 40

Worksheet time: 37mins

Name
Class
Date
1.
How many times will this loop iterate? 
a)
4
b)
7
c)
5
d)
6
2.
Which are true regarding high-level and low-level programming languages?
I. High-level can be more abstract
II. Low-level is harder to find errors
III. High-level is more easily understood by humans. 
a)
I and II
b)
I, II, and III
c)
II and III
d)
III only
3.
How many binary digits are needed to write the decimal number 999?
a)
8
b)
9
c)
10
d)
11
4.
Which of the following is an example of abstraction?
a)
Writing a function for code you repeat often
b)
Using logic symbols like < and >
c)
Numbers are converted from one base to another
d)
There is an error in the code
5.
Which of the following tasks would best be accomplished by a LOOP?
a)
Drawing a circle of any size on the screen
b)
Drawing a hexagon (6 sided shape)
c)
Drawing out the letters of the word "HELLO"
d)
Determining whether a number is odd or even
6.
Which of the following would best be accomplished by a function? 
a)
Drawing out the letters of a word
b)
Drawing 100 tiny dots in a line
c)
Determining if a variable is true or false
d)
Drawing a pentagon
7.
Programming languages have some similarities and differences to the “natural” language you use in everyday speech. Select the true statement about programming languages:
a)
Compared to the number of words in a natural language, the number of defined words in a programming language is very small. 
b)
The number of defined words in a programming language is about the same as the number of words in a natural language. 
c)
There are typically many possible ways to interpret an instruction written in a programming language. 
d)
The number of defined words in natural language is very small compared to programming language
8.
For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing a hexagon (six-sided shape)
a)
Loop 
b)
Function(s) 
9.
For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task:Drawing a circle of any size at any point on the screen
a)
Loop 
b)
Function(s) 
10.
Why are parameters useful when programming?
a)
Parameters determine the number of times the function will run. 
b)
Parameters allow for more flexible, generalized behaviors in functions.
c)
Parameters are useful for teams of programmers because they help define the boundaries of the problem they are trying to solve. 
d)
Parameters change the order of operations within a function. 
11.
Finding and fixing problems in your algorithm or program
a)
debugging
b)
hacking
c)
cracking
d)
problem solving
12.
A single value of either TRUE or FALSE
a)
Boolean
b)
Julian
c)
Null
d)
Conditional
13.
What is a sequence of instructions which enables a computer to perform a desired task?
a)
program
b)
compiler
c)
assembly
d)
algorithm
14.
What is a list of steps that you can follow to finish a task?
a)
commands
b)
wires
c)
algorithm
d)
program
15.
______________ of an object can be changed in the properties tab to create “appearing” or “disappearing” effects.
a)
Color
b)
Opacity
c)
Transition
d)
Size
16.
Convert 37 to binary
a)
00100101
b)
00100011
c)
00100111
d)
01000101
17.
Convert 11001100 to decimal
a)
224
b)
134
c)
104
d)
204
18.
Programming languages have more "words" than natural (spoken/written) languages
a)
True
b)
False
c)
They have about the same number of words
19.
Multiple functions within a program can have the same name
a)
True
b)
False
20.
Which of the following is true regarding naming functions? 
a)
Function names can be reused multiple times
b)
A function name should be as descriptive as possible to indicate what the function does.
c)
Function names should be organized alphabetically
d)
The function name should begin with a number that indicates the order in which it should be executed.
21.
What is the correct way to call the function called "doMath" with a parameter of 5?
a)
doMath(5);
b)
function doMath(5);
c)
doMath();
d)
doMath{5};
22.
Which of the following commands will move the turtle forward one unit?
a)
move
b)
move;
c)
move();
d)
move()
23.
What makes the following command invalid: turnleft();
a)
It should end in a colon rather than a semicolon
b)
The letter l should be capitalized - L
c)
It should start with a capital T
d)
The command is correct
24.
Why do we use functions in programs?
a)
A.  Make the program easier to read
b)
B.  Avoid retyping the same lines of code
c)
C.  Both A and B are correct
d)
D. Neither A nor B are correct
25.
What is wrong with this program?
a)
The "go" function is called twice
b)
The "go" function has a syntax error
c)
The "go" function has been defined twice
d)
"go" is not a command that 
26.
Getting things done with the least amount of time and resources is 
a)
An algorithm
b)
Abstraction
c)
Efficiency
27.
A loop is the same as
a)
a function
b)
iteration
c)
sequencing
28.
High Level programming is a programming language that captures only the most primitive operations available to a machine.
a)
True
b)
False
29.
Which of the following is written in camel case?
a)
computerScience
b)
ComputerScience
c)
COMPUTERSCIENCE
d)
computerSCIENCE
30.
Top-down design is
a)
a problem solving approach (also known as stepwise design) in which you break down a system to gain insight into the sub-systems that make it up
b)
a parameter
c)
a programming language
31.
A benefit of using well-named functions and parameters in a computer program is
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 not need parameters
32.

When you run code, this is when the computer will start at line 1, then execute line 2 then line 3 and so on until it reaches the last line of your program.

a)

Selection

b)

Sequencing

c)

Iteration

33.

Sometimes you only want some lines of code to be run only if a condition is met, otherwise you want the computer to ignore these lines and jump over them.

a)

Selection

b)

Sequencing

c)

Iteration

34.

Which of the following code options can be used to move the robot (the black triangle) to the gray square?

a)

REPEAT 2 TIMES:

{

MOVE_FORWARD ()

ROTATE_LEFT ()

MOVE_FORWARD ()

MOVE_FORWARD ()

ROTATE_LEFT ()

}

b)

REPEAT 4 TIMES:

{

ROTATE_LEFT ()

MOVE_FORWARD ()

ROTATE_RIGHT ()

MOVE_FORWARD ()

ROTATE_RIGHT ()

MOVE_FORWARD ()

ROTATE_LEFT ()

}

c)

REPEAT 3 TIMES:

{

MOVE_FORWARD ()

MOVE_FORWARD ()

ROTATE_RIGHT ()

MOVE_FORWARD ()

}

d)

REPEAT 3 TIMES:

{

MOVE_FORWARD ()

MOVE_FORWARD ()

ROTATE_LEFT ()

MOVE_FORWARD ()

}

35.

A new or improved idea, device, product, etc, or the development thereof.

a)

Innovation

b)

Technology

c)

Improvement

d)

Protocol

36.

A way of representing information using only two options.

a)

BInary

b)

Doubled

c)

Algorithm

d)

Hexadecimal

37.
A(n) ___________ is a simplified representation of something more complex that lets you hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.
a)
Selection
b)
Abstraction
c)
Function
38.
_____________________ is a problem solving approach in which you break down a system to gain insight into the sub-systems that make it up.
a)
Step design
b)
Bottom-Up design
c)
Top-Down design
39.
A collection of commands made available to a programmer is an ____.
a)
Documentation
b)
API
c)
Parameter
40.

A predication made by Gordon Moore in 1965 that computing power will double every 1.5-2 years, it has remained more or less true ever since.

a)

Moore's Law

b)

Moore's Theory

c)

Moore's Principle

d)

Luka's Law of Interplanetary Motion