wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Code.org Unit 3 1-8 Review

Total questions: 50

Worksheet time: 41mins

Name
Class
Date
1.
Which command does this create
ellipse()
a)
oval
b)
 rectangle
c)
triangle 
d)
none of the above
2.
Which shape does this command create
rect()
a)
rectangle
b)
oval
c)
triangle
d)
none of the above
3.
Which command places a oval in the top right of the game lab
a)
ellipse(200,300);
b)
ellipse(200,200);
c)
ellipse(300,50);
d)
ellipse (50,100);
4.
What does the fill command do
a)
Fill a shape with  color
b)
Fill a shape with other shapes
c)
Adds a border to your shape
d)
none of the above
5.
Bug - Part of a program that does not work correctly.
a)
True
b)
False
6.
Debugging - Finding and fixing problems in your algorithm or program.
a)
True
b)
False
7.
What is an Algorithm?
a)
A series of instructions on how to accomplish a task
b)
a way to play the drums
c)
a way to write music on paper
d)
long division
8.
Program - An algorithm that has been coded into something that can be run by a machine.
a)
True
b)
False
9.
How many Sprites are drawn with this code
var sprite = createSprite(300, 100);
sprite.setAnimation("Bunny");
drawSprites();
var sprite1 = createSprite (300, 200);
sprite1.setAnimation("Chick");
a)
1
b)
2
c)
3
d)
4
10.
A placeholder for a piece of information that can change is called a(n) __________.
a)
Math block
b)
Parenthesis
c)
Quotation
d)
Variable
11.
An extra piece of information that you pass to the function to customize it for a specific need is called a ____________.
a)
Paraphrase
b)
Perimeter
c)
Parameter
12.
Are spaces allowed in Naming Variables?
a)
True
b)
False
c)
None of the above
13.
What does an equal sign mean in a variable?
a)
Equal to
b)
Gets the value of
c)
Value
d)
Some number
14.
What does the stroke do?
a)
Change the inside color of an ellipse
b)
Change the outside color of an ellipse
c)
Nothing
15.
What is the command name of variable?
a)
Variable
b)
Size
c)
Var
d)
X
16.
What is a function, in the context of Computer Science?
a)
a piece of code that can be called over and over
b)
what an object does
c)
a part of math
d)
the opposite of dysfuntional
17.
Would this example code run correctly?
Line 1: var xPosition
Line 2: ellipse (Xposition, 200, 50, 150);
a)
Yes
b)
No 
c)
Maybe
18.
What is the x position in the following code: 
rect (200, 150, 50, 350);
a)
1st position
b)
2nd position
c)
3rd position
d)
4th position
19.
What is the y position in the following code: 
rect (200, 150, 50, 350);
a)
1st position
b)
2nd position
c)
3rd position
d)
4th position
20.
What will the following code do to the picture?
ellipse(randomNumber(0,400), randomNumber(0,400));
a)
Change the place of the ellipse on both the x and y axis
b)
Change the size of the ellipse
c)
Put the ellipse at position (400,400)
d)
Change the place of the ellipse on the x axis
21.
A block that can be used to generate random numbers in your program called?
a)
RandomNumber()
b)
randomNumber()
c)
randomnumber()
d)
Randomnumber()
22.
What is the height position in the following code: 
rect (200, 150, 50, 350);
a)
1st position
b)
2nd position
c)
3rd position
d)
4th position
23.
What is the width position in the following code: 
rect (200, 150, 50, 350);
a)
1st position
b)
2nd position
c)
3rd position
d)
4th position
24.
What does sprite.y do?
a)
Moves the sprite on the y axis
b)
Moves the spite on the x axis
c)
Moves the sprite of both y and x axis
d)
Moves the sprite in a circle
25.
What does sprite.x do?
a)
Moves the sprite on the y axis
b)
Moves the spite on the x axis
c)
Moves the sprite of both y and x axis
d)
Moves the sprite in a circle
26.
What does sprite.rotation do?
a)
Moves the sprite on the y axis
b)
Moves the spite on the x axis
c)
Moves the sprite of both y and x axis
d)
Rocks the sprite back and forth
27.
Frame Rate is the rate at which frames in an animation are shown, typically measured in frames per minute.
a)
True
b)
False
28.
Frame is a single image within an animation.
a)
True
b)
False
29.
Expression is any valid unit of code that resolves to a value.
a)
True
b)
False
30.
What is the purpose for the draw loop?
a)
To loop one drawing
b)
To loop anything that is within the draw loop function.
c)
There is no purpose
d)
To draw one sprite over and over again.
31.
What is the correct format to define a function? 
Note: Function is named "multiplyBy2"
a)
multiplyBy2();
b)
function multiplyBy2(){
//steps to execute function
}
c)
function multiplyBy2
d)
multiplyBy2{5}{
//steps of function
}
32.
What is the correct way to call the function called "doMath" with a parameter of 5?
a)
doMath(5);
b)
function doMath(5);
c)
doMath();
d)
doMath{5};
33.

What makes the following command invalid: turnleft();

a)

It should end in a colon rather than a semicolon

b)

The letter l should be capitalized - L

c)

It should start with a capital T

d)

The command is correct

34.

Why do we use functions in programs?

a)

A. Make the program easier to read

b)

B. Avoid retyping the same lines of code

c)

C. Both A and B are correct

d)

D. Neither A nor B are correct

35.

In this code, how many times is the "dance" function called and how many times is it defined?

a)

called 1 time, defined 1 time

b)

called 1 time, defined 3 times

c)

called 3 times, defined 1 time

d)

called 3 times, defined 3 times

36.
How do you call a function in JavaScript?
(assume the function name is doStuff)
a)
function doStuff()
b)
doStuff()
c)
doStuff();
d)
function do Stuff(){
//list of steps to execute
}
37.
Which of the following is an example of abstraction?
a)
Writing a function for code you repeat often
b)
Using logic symbols like < and >
c)
Numbers are converted from one base to another
d)
There is an error in the code
38.
Two different functions in a program could contain the same code (accomplish the same task)
a)
True
b)
False
39.
Which of the following is true regarding naming functions? 
a)
Function names can be reused multiple times
b)
A function name should be as descriptive as possible to indicate what the function does.
c)
Function names should be organized alphabetically
d)
The function name should begin with a number that indicates the order in which it should be executed.
40.
What would "X = (X + 50;)" do?
a)
Create an error.
b)
Change X by 50.
c)
It would create an ellipse at X 50.
d)
Add 50 to the variable X.
41.
What does "sprite.scale" do?
a)
It controls the sprite's X position.
b)
It controls the sprite's Y position.
c)
It controls the size of the sprite.
d)
It controls the sprite's rotation.
42.
What does the "DrawSprites" function do?
a)
It draws all sprites defined by a variable.
b)
It draws all the sprites in the animation tab.
c)
It draws a spooky ghost.
d)
It defines all the sprites in the animation tab.
43.
How do you correctly define a sprite?
a)
var = "sprite" createSprite(200, 200);
b)
var sprite = createSprite();
c)
A sprite is a character. 
d)
var "sprite" createSprite(200, 200);
44.

Sprite

a)

A graphic character on the screen with properties that describe its location, movement, and look.

b)

A placeholder for a piece of information that can change.

c)

Attributes that describe an object's characteristics

d)

An algorithm that has been coded into something that can be run by a machine.

45.

Function

a)

A placeholder for a piece of information that can change.

b)

a series of images that create the illusion of motion by being shown rapidly one after the other

c)

A piece of code that you can easily call over and over again.

d)

Attributes that describe an object's characteristics

46.

Property

a)

Attributes that describe an object's characteristics

b)

An algorithm that has been coded into something that can be run by a machine.

c)

Pulling out specific differences to make one solution work for multiple problems.

d)

An algorithm that has been coded into something that can be run by a machine.

47.

Animation

a)

The common programming structure that implements "conditional statements".

b)

a series of images that create the illusion of motion by being shown rapidly one after the other

c)

A graphic character on the screen with properties that describe its location, movement, and look.

d)

Pulling out specific differences to make one solution work for multiple problems

48.

Frame Rate

a)

the rate at which frames in an animation are shown, typically measured in frames per second

b)

Pulling out specific differences to make one solution work for multiple problems.

c)

A graphic character on the screen with properties that describe its location, movement, and look.

d)

A placeholder for a piece of information that can change.

49.

Frame

a)

a single image within an animation

b)

Finding and fixing problems in your algorithm or program.

c)

the rate at which frames in an animation are shown, typically measured in frames per second

d)

in programming, an expression that evaluates to True or False.

50.

Variable

a)

An extra piece of information that you pass to the function to customize it for a specific need.

b)

The common programming structure that implements "conditional statements".

c)

Attributes that describe an object's characteristics

d)

A placeholder for a piece of information that can change.