wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AP CSP Unit 3 Review

Total questions: 22

Worksheet time: 13mins

Name
Class
Date
1.

Any programming language that lets users create programs by manipulating “blocks” or graphical programming elements, rather than writing code using text.

a)

Command

b)

Run Program

c)

Algorithm

d)

Block-based programming language

2.

An error in a program that prevents the program from running as expected

a)

onEvent

b)

Bug

c)

Moth

d)

Fly in the Ointment

3.

Statements that should only run upon a specific user action should be placed

a)

inside an onAction block

b)

below an onEvent command

c)

after the first programming statement

d)

within an onEvent programming statement

4.

Finding and fixing problems in an algorithm or program

a)

Debugging

b)

Event Driven Programming

c)

Run Programs

d)

Algorithms

5.

Cause the computer to execute the commands you've written in your program

a)

console.log

b)

Run Program

c)

Debug

d)

onEvent

6.

A single instruction for the computer. Put many together and you get algorithms and computer programs.

a)

Algorithm

b)

onEvent

c)

console.log

d)

Command

7.

A set of steps you can follow in order to solve a problem or achieve a result often written down in regular spoken language.

a)

Debugging

b)

Event

c)

Algorithm

d)

Computer Program

8.

When the user hovers their mouse over the hawk, the

a)

both birds will appear only in the middle of the screen

b)

The sparrow will be confined to the upper right and the hawk to the upper left

c)

The sparrow will be confined to the lower right and the hawk to the upper left

d)

The sparrow will be confined to the lower left and the hawk to the upper right

9.

Choose all the correct options. When debugging, you should

a)

run the program over and over, staring really hard at it

b)

add some console.log statements to see what is going on

c)

describe your program and the odd behavior to a friend

d)

reduce the amount of code and see if the behavior improves

10.

There are many possible ways to interpret an instruction written in a programming language.

a)

True

b)

False

11.

Which of the following is not true about functions?

a)

Functions are reusable programming abstractions

b)

Functions can reduce complexity of writing and maintaining programs

c)

Functions cannot make calls to other functions within the same program

d)

Once defined, a function can be called many times from different parts of the program.

12.

The program above is run. Then the user clicks the "blueButton" button ONCE. What will be displayed in the console?

a)

"1"

"2"

"3"

b)

"1"

"3"

c)

"2"

"1"

"3"

d)

"1"

"3"

"2"

13.

What color is blueButton after the code above runs?

a)

blue

b)

red

c)

green

d)

yellow

14.

What color is redButton after the code above runs?

a)

blue

b)

red

c)

green

d)

yellow

15.

The program above is run. What color is blueButton if the user DOES NOT click blueButton?

a)

blue

b)

red

c)

green

d)

yellow

16.

The program above is run. What color is blueButton if the user clicks blueButton once?

a)

blue

b)

red

c)

green

d)

yellow

17.

The following program is run. Then the user clicks the "redButton" ONCE and then clicks the "blueButton" ONCE. What will be displayed in the console?

a)

"1"

"3"

"5"

"2"

"4"

b)

"2"

"4"

c)

"1"

"3"

"5"

"4"

"2"

d)

"4"

"2"

e)

"1"

"2"

"3"

"4"

"5"

18.

What will the console log say when this program is run?

a)

"Starting my program!"

"You clicked the button!"

"Ending my program!"

b)

"Starting my program!"

"Ending my program!"

"You clicked the button!"

c)

"You clicked the button!"

"Starting my program!"

"Ending my program!"

d)

"You clicked the button!"

"Ending my program!"

"Starting my program!"

19.

Which of the following is not one of the purposes of having potential users test a program or app?

a)

To write the code for the program/app.

b)

To see if there are any bugs in the program/app.

c)

To get input on the design of the program/app.

d)

To see how a user interacts with the app/program.

20.

Which line of code is most likely to return an error?

a)

1

b)

2

c)

3

d)

4

21.

Which of the following describes "event-driven programming?"

a)

Commands run one at a time in the order that they are written.

b)

Commands run one at a time in response to user interactions or other events.

c)

Commands all run at the same time when the user interacts with the app.

d)

Commands all run whether or not the user interacts with the program.

22.

What is a reason to include comments in a program?

a)

Comments tell the computer what the code is doing.

b)

Comments tell the programmer what the code is doing.

c)

Comments help the user work an app more effectively.

d)

Comments will show up in the console so when the program is run, the programmer know what happens.