Font size
WorksheetsAP CSP Unit 3 Review
Total questions: 22
Worksheet time: 13mins
Any programming language that lets users create programs by manipulating “blocks” or graphical programming elements, rather than writing code using text.
Command
Run Program
Algorithm
Block-based programming language
An error in a program that prevents the program from running as expected
onEvent
Bug
Moth
Fly in the Ointment
Statements that should only run upon a specific user action should be placed
inside an onAction block
below an onEvent command
after the first programming statement
within an onEvent programming statement
Finding and fixing problems in an algorithm or program
Debugging
Event Driven Programming
Run Programs
Algorithms
Cause the computer to execute the commands you've written in your program
console.log
Run Program
Debug
onEvent
A single instruction for the computer. Put many together and you get algorithms and computer programs.
Algorithm
onEvent
console.log
Command
A set of steps you can follow in order to solve a problem or achieve a result often written down in regular spoken language.
Debugging
Event
Algorithm
Computer Program
When the user hovers their mouse over the hawk, the
both birds will appear only in the middle of the screen
The sparrow will be confined to the upper right and the hawk to the upper left
The sparrow will be confined to the lower right and the hawk to the upper left
The sparrow will be confined to the lower left and the hawk to the upper right
Choose all the correct options. When debugging, you should
run the program over and over, staring really hard at it
add some console.log statements to see what is going on
describe your program and the odd behavior to a friend
reduce the amount of code and see if the behavior improves
There are many possible ways to interpret an instruction written in a programming language.
True
False
Which of the following is not true about functions?
Functions are reusable programming abstractions
Functions can reduce complexity of writing and maintaining programs
Functions cannot make calls to other functions within the same program
Once defined, a function can be called many times from different parts of the program.
The program above is run. Then the user clicks the "blueButton" button ONCE. What will be displayed in the console?
"1"
"2"
"3"
"1"
"3"
"2"
"1"
"3"
"1"
"3"
"2"
What color is blueButton after the code above runs?
blue
red
green
yellow
What color is redButton after the code above runs?
blue
red
green
yellow
The program above is run. What color is blueButton if the user DOES NOT click blueButton?
blue
red
green
yellow
The program above is run. What color is blueButton if the user clicks blueButton once?
blue
red
green
yellow
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?
"1"
"3"
"5"
"2"
"4"
"2"
"4"
"1"
"3"
"5"
"4"
"2"
"4"
"2"
"1"
"2"
"3"
"4"
"5"
What will the console log say when this program is run?
"Starting my program!"
"You clicked the button!"
"Ending my program!"
"Starting my program!"
"Ending my program!"
"You clicked the button!"
"You clicked the button!"
"Starting my program!"
"Ending my program!"
"You clicked the button!"
"Ending my program!"
"Starting my program!"
Which of the following is not one of the purposes of having potential users test a program or app?
To write the code for the program/app.
To see if there are any bugs in the program/app.
To get input on the design of the program/app.
To see how a user interacts with the app/program.
Which line of code is most likely to return an error?
1
2
3
4
Which of the following describes "event-driven programming?"
Commands run one at a time in the order that they are written.
Commands run one at a time in response to user interactions or other events.
Commands all run at the same time when the user interacts with the app.
Commands all run whether or not the user interacts with the program.
What is a reason to include comments in a program?
Comments tell the computer what the code is doing.
Comments tell the programmer what the code is doing.
Comments help the user work an app more effectively.
Comments will show up in the console so when the program is run, the programmer know what happens.
