wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

JavaScript Final Exam Study Guide

Total questions: 28

Worksheet time: 28mins

Name
Class
Date
1.

What is missing in this code block?

a)

x

b)

y

c)

width

d)

height

2.

What is the width of the rectangle?

a)

30

b)

50

c)

100

d)

150

3.

What will most likely be displayed by this code?

a)

pig

b)

rectangle

c)

bear

d)

circle

4.

Will this code draw an ellipse that is fully visible on the screen?

a)

Always

b)

Sometimes

c)

Never

5.

What color is the ellipse?

a)

Red and gray

b)

Black and gray

c)

Red and blue

d)

Black and blue

6.

What text will be displayed by this code?

a)

words

b)

hello

c)

0

d)

15

e)

Nothing

7.

What will be displayed by this code?

a)

Nothing

b)

A white background

c)

A yellow background

d)

Blue text on a white background

e)

Blue text on a yellow background

8.

What does this tool do?

a)

Flip

b)

Rotate

c)

Cut

d)

Paste

9.

What does this tool do?

a)

Draw a rectangle

b)

Select items

c)

Change border style

d)

Crop the image

10.

What is the purpose of this code tile?

a)

Prevent medical emergency.

b)

Stop drawing of text.

c)

Stop drawing of outlines.

d)

Stop all drawing.

11.

Which of these is the correct way to use a draw loop?

a)
b)
c)
d)
12.

Which direction will the sprite move on the screen?

a)

Left

b)

Right

c)

Up

d)

Down

e)

None

13.

Which direction will the sprite move?

a)

Up

b)

Down

c)

Left

d)

Right

e)

None

14.

What color will be displayed?

a)

Red

b)

Green

c)

Blue

d)

Yellow

15.

Which tiles or blocks can be used to get the current position of the mouse cursor?

a)
b)
c)
d)
16.

What will be displayed by this code?

a)

Nothing

b)

A tree

c)

A tree and a rectangle

d)

A rectangle

17.

What is wrong with this code block?

a)

It should say YELLOW in caps.

b)

It should say "yellow" in quotes.

c)

There is no fill code block in Game Lab.

d)

Yellow is not a color recognized by name.

18.

Which of these is a reasonable value to use in this code block?

a)

1

b)

15

c)

150

d)

1500

e)

0.1

19.

This tile represents...

a)

Greater than

b)

Less than

c)

Insert into

d)

A pointy nose

20.

What is the possible range of values for x?

a)

100 to 200

b)

100 to 250

c)

150 to 250

d)

150 to 200

21.

A team of friends is creating a game together. They want to make sure that everyone can understand the code that the others write. Which of the following will make it easier for them to read each other's code?

a)

Use the counter pattern to increase the score.

b)

Include descriptive comments in the program.

c)

Use watchers to keep track of variable and sprite property values.

d)

Give variables and functions names that begin with numbers.

22.

Which of the following is a true statement about functions in JavaScript?

a)

They create and organize sprites and sprite attributes.

b)

They do not need to be debugged because code within them can be in any order.

c)

They are not a necessary part of the code in order for a program to run.

d)

They let you use the same code in different places in the program without having to rewrite it.

23.

What is the banana's x position at the end of this program?

a)

20

b)

60

c)

90

d)

80

24.

A programmer identifies a problem that exists in their code, but is unable to locate it. What can the programmer do to help them find and fix the error?

a)

Use the debug console to track outputs.

b)

Use a loop to see how many iterations of the problem exists.

c)

Leave the code as it is and hope the error will fix itself.

d)

Delete everything and start over.

25.

A team is making a platform jumper game. The background and platforms are working, but the main character won't appear. Which of the following might be the problem?

1. They forgot to call drawSprites in the draw loop.

2. The character sprite is drawn behind the background sprite.

3. The character sprite is drawn off the screen.

a)

3 only

b)

1 and 2

c)

2 and 3

d)

1, 2, and 3

26.

What color will the background be when the code is run?

a)

Blue

b)

Yellow

c)

Blue, then changes to red

d)

Red, then changes to blue

27.

The program creates a variable named counter. Which of the following is true about the code?

a)

The counter pattern is within the draw function, so it will update repeatedly.

b)

The counter variable is initialized in the draw function.

c)

The background overlays the counter text, so you aren't able to see the counter.

d)

The counter pattern adds 400 to the value of the variable each time it is called.

28.

Which result will be printed in the console by this program?

a)

true

false

true

b)

0

200

100

c)

true

error

true

d)

false

true

false