WorksheetsCPA Practice 9-29-2021
Total questions: 19
Worksheet time: 11mins
What is the best replacement for /* missing code */ on line 8?
X > 301
x === 301
x = 301
x < 301
What would best fill in the blank of this description from the p5 reference?
key
mouseX
mouseY
keyTyped
What would best fill in the blank of this description from the p5 reference?
keyPressed
mouseX
mouseY
keyCode
How many variables are defined in this JavaScript program?
0
1
2
3
Any code that is within the following draw function:
function draw(){
......
}
Will be performed twice
Will not be performed
Will be performed once
Will be repeated over and over again
How many functions are defined in this JavaScript program?
0
1
2
3
Which of the following would be an example of a "special key" that was added to computer keyboards later than other keys?
space
down arrow
&
(
What do c and d represent in this function call?
The x and y coordinates of the shape's top left corner
The width and height of the shape
The x and y coordinates of the shape's center
The x and y coordinates of the shape's bottom right corner
What will be printed by this program?
0
3
10
cannot be determined
This program is meant to "wrap" a moving circle around the screen when the y coordinate is too large, but it has an error. Which line has the error?
1
8
10
11
What will be printed by this program?
0
3
10
cannot be determined
What is the scope of the variables x, y and z in this program?
Global (The entire program)
Local to the draw() function only
Local to the setup() function only
Which replacement for /* missing code */ on line 9 would move the ellipse in a random walk where the ellipse was equally likely to wiggle left or right?
x = random(-400);
x = random(-2,2);
x = x + random(-2,3);
x = x + random(-2,2);
Why is line 9 causing an error?
The variable y is Global and cannot be used in the draw() function
The variable y is local to setup() and cannot be used in the draw() function
Line 4 should be var y === 0;
Line 4 should be define y = 0;
Which replacement for /* missing code */ on line 9 would move the ellipse in a biased random walk where the ellipse was more likely to wiggle right than left?
x = random(-400);
x = random(-2,2);
x = x + random(-2,3);
x = x + random(-2,2);
