Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Shapes and Color Coding (JavaScript)

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

After we put a command in a program, we always end it with parenthesis and a ___________.

a)

semicolon

b)

period

c)

colon

d)

exclamation point

2.

Look at this command:

ellipse(x, y, w, h);


The "x" parameter says how far ________ or _______the ellipse is on the canvas.

a)

up; down

b)

left; right

c)

southeast; northwest

d)

Neither

3.

Look at these commands:

ellipse(100, 200, 30, 40);

rect(100, 225, 12, 20);


The numbers in these ellipse and rect commands are called:

a)

sundaes

b)

measurements

c)

letters

d)

parameters

4.

What is the purpose of putting comments in your code?

a)

To help you label what you are coding

b)

To help you run faster

c)

To make it harder for you to code

d)

None of these answers

5.

What is a comment in programming?

a)

2 slashes with a bit of text after it to tell you what the code does

b)

Something Instagrammers use to edit their photos

c)

A way to cancel the code

d)

None of these

6.

What is an error, flaw or mistake in a computer program that causes the code not to work in the way you wanted it to?

a)

virus

b)

bug

c)

insect

d)

flu

7.

Is it important to put your code in a particular order?

a)

Yes

b)

No

8.

The fill command colors in:

a)

Shapes

b)

Lines

c)

Backgrounds

d)

Outlines of shapes

9.

What does the stroke command do?

a)

Colors in shapes

b)

Only changes the colors of lines

c)

Changes the color of lines AND the outline colors of shapes

d)

Colors the background

10.

What does the noStroke( ); command do?

a)

Turns off any shape outlines

b)

Makes all shapes have outlines

c)

Fills in the color of shapes

d)

None of these

11.

What is the point of using variables in code?

a)

To make life easier for the coder

b)

To give the coder more work

c)

To make the computer miscommunicate

d)

To make your life harder

12.

What is a variable?

a)

A value that can change depending on information passed through the program

b)

A creative solution for viruses

c)

None of these