Font size
Worksheetscode.org CSP Unit 3 Review 20-21
Total questions: 15
Worksheet time: 12mins
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"
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
A sequence of steps written in a programming language that can be followed to solve a problem, especially by a computer.
Debug
Event
Algorithm
Computer Program
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
Program statement
When the user hovers their mouse over the hawk,
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
