Font size
WorksheetsAP CSP 12-2 U4L1 Variable
Total questions: 9
Worksheet time: 16mins
What number will be output by the console.log command on line 7?
10
100
20
200
What text will be output by the program?
less than 10
less than 20
less than 30
30 or more
What will be the order of letters printed to the console when this program is run?
a b c
a b c b c b c
a b c b c
a b c a
A movie theater charges different ticket prices based on a customer's age. The prices are shown in the table below.
The customer's age is stored in the variable age and the price is stored in the variable price. Which piece of code will correctly decide the price for each ticket.
What will the value of the variable bags be at the end of the flowchart shown here?
1
2
3
4
Evaluate:
10 / 2 evaluates to
1
0.5
2
5
What is the result of running this program and clicking on a buttonUp button 20 times?
00 var Count
01 Count = 0
02 onevent(buttonUp, Click), Count = Count + 1
Count = 0
Count = 19
Count = 20
Count = Undefined
Assume that the two variables age and day have been initialized with the values shown.
var age = 16;
var day = "Monday";
Determine if the following statement evaluates to true or false.
(age > 10) && (age < 20)
true
false
Assume that the two variables age and day have been initialized as shown below.
var age = 16;
var day = "Monday";
Determine if the following statement evaluates to true or false.
(day == "Tuesday") || (age < 12)
true
false
