WorksheetsPractice for Comp Prog A Quiz #5
Total questions: 18
Worksheet time: 9mins
What kind of array is grid?
1d
2d
3d
4d
How many rows does grid have?
1
2
3
4
How many columns does grid have?
1
2
3
4
What would be returned by the call mystery([0,2,4,6])?
false
true
undefined
What is the value of grid[0][0]?
false
true
undefined
What is 17 % 19?
1
2
17
19
What is the value of grid[2][0]?
false
true
undefined
What would be returned by the call mystery([3, 4])?
7
-1
[4,3]
[3,4]
What is the value of grid[0][2]?
false
true
undefined
Which of the following if statements would test to see if a row number was NOT valid on a 5x5 grid because it was above the top of the grid?
if(r<0)
if(r<=0)
if(r>0)
if(r>=0)
What is the output of this program?
11 4
36 -4
8 -4
7 6
What is 19 % 17?
1
2
17
19
Which of the following would be the best replacement for /* missing code */ for flipLight in the lights out game?
true
false
!grid[row][col]
Which of the following if statements would test to see if a row number was NOT valid on a 5x5 gird because it was below the bottom of the grid?
if(r<4)
if(r<=4)
if(r>4)
if(r>=4)
What is 11 % 523496?
0
11
523496
error
How many variables are in this JavaScript program?
1
2
5
11
Which of the following if statements would test to see if a row number was NOT valid on a 5x5 grid because it was below the bottom of the grid?
if(r<4)
if(r<=4)
if(r>4)
if(r>=4)
What is the output of this program?
4 3
16 15
4 4
-4 -3
