CSP Unit 4 Variables, Conditionals, and
Function Assessment Exam Questions
With Revised Answers
What number will be output by the console.log command on line 7? - answer✔✔100
What number will be output by the console.log command on line 5? - answer✔✔16
What number will be output by the console.log command on line 5? - answer✔✔35
What text will be output by the program? - answer✔✔30 or more
What text will be output by the program? - answer✔✔Output D
What will be the order of letters printed to the console when this program is run? - answer✔✔a b
cbc
"You win!" never displays. What line is responsible for this error? - answer✔✔3
When this function is called, the smaller of two numbers is displayed. What Boolean expression
would not work in line 12 in order to accomplish this goal? - answer✔✔num1 == num2
This function chooses the screen to display based on the score. What is the correct way to call
this function? - answer✔✔checkWin();
There is repeated code in these onEvent blocks. Choose the correct code for the updateScreen()
function which would be called in each of the onEvent blocks. - answer✔✔function
updateScreen() {
set Text("counter_label", counter);
if (counter == 0) {
setProperty("counter_label", "font-size", 24);
}
}