Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CPA Practice 9-29-2021

Total questions: 19

Worksheet time: 11mins

Name
Class
Date
1.
Which command colors the background of your canvas?
a)
background 
b)
endShape
c)
var = color
d)
fill
2.

What is the best replacement for /* missing code */ on line 8?

a)

X > 301

b)

x === 301

c)

x = 301

d)

x < 301

3.
What command removes the outlines from shapes?
a)
noOutline ();
b)
noColor();
c)
noBorder();
d)
noStroke ();
4.

What would best fill in the blank of this description from the p5 reference?

a)

key

b)

mouseX

c)

mouseY

d)

keyTyped

5.
What command draws a perfect circle?
a)
ellipse (80, 60, 100, 105);
b)
ellipse(80, 60, 100, 100);
c)
circle (80, 60, 80, 60):
d)
ellipse (80, 60, 105, 100);
6.

What would best fill in the blank of this description from the p5 reference?

a)

keyPressed

b)

mouseX

c)

mouseY

d)

keyCode

7.

How many variables are defined in this JavaScript program?

a)

0

b)

1

c)

2

d)

3

8.

Any code that is within the following draw function:

function draw(){

......

}

a)

Will be performed twice

b)

Will not be performed

c)

Will be performed once

d)

Will be repeated over and over again

9.

How many functions are defined in this JavaScript program?

a)

0

b)

1

c)

2

d)

3

10.
JavaScript uses the _______ keyword to define variables.
a)
vrb
b)
var
c)
vari
d)
va
11.

Which of the following would be an example of a "special key" that was added to computer keyboards later than other keys?

a)

space

b)

down arrow

c)

&

d)

(

12.

What do c and d represent in this function call?

a)

The x and y coordinates of the shape's top left corner

b)

The width and height of the shape

c)

The x and y coordinates of the shape's center

d)

The x and y coordinates of the shape's bottom right corner

13.

What will be printed by this program?

a)

0

b)

3

c)

10

d)

cannot be determined

14.

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?

a)

1

b)

8

c)

10

d)

11

15.

What will be printed by this program?

a)

0

b)

3

c)

10

d)

cannot be determined

16.

What is the scope of the variables x, y and z in this program?

a)

Global (The entire program)

b)

Local to the draw() function only

c)

Local to the setup() function only

17.

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?

a)

x = random(-400);

b)

x = random(-2,2);

c)

x = x + random(-2,3);

d)

x = x + random(-2,2);

18.

Why is line 9 causing an error?

a)

The variable y is Global and cannot be used in the draw() function

b)

The variable y is local to setup() and cannot be used in the draw() function

c)

Line 4 should be var y === 0;

d)

Line 4 should be define y = 0;

19.

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?

a)

x = random(-400);

b)

x = random(-2,2);

c)

x = x + random(-2,3);

d)

x = x + random(-2,2);