wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Unit 3 Code.org Question Bank for FOC

Total questions: 80

Worksheet time: 47mins

Name
Class
Date
1.
Program
a)
Attributes that describe an object's characteristics
b)
A graphic character on the screen with properties that describe its location, movement, and look.
c)
An algorithm that has been coded into something that can be run by a machine.
d)
A placeholder for a piece of information that can change.
2.
Parameter
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)
the rate at which frames in an animation are shown, typically measured in frames per second
d)
Pulling out specific differences to make one solution work for multiple problems.
3.
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
4.
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.
5.
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.
6.
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
7.
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.
8.
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.
9.
Boolean
a)
A single value of either TRUE or FALSE
b)
Any valid unit of code that resolves to a value.
c)
Part of a program that does not work correctly.
10.
If-Statement
a)
 The common programming structure that implements "conditional statements".
b)
 Attributes that describe an object's characteristics
c)
An algorithm that has been coded into something that can be run by a machine.
d)
Part of a program that does not work correctly.
11.
Conditionals
a)
Any valid unit of code that resolves to a value.
b)
a single image within an animation
c)
Statements that only run under certain conditions.
d)
Any valid unit of code that resolves to a value.
12.
Bug
a)
Part of a program that does not work correctly.
b)
the rate at which frames in an animation are shown, typically measured in frames per second
c)
An algorithm that has been coded into something that can be run by a machine.
d)
A graphic character on the screen with properties that describe its location, movement, and look.
13.
Boolean Expression
a)
a single image within an animation
b)
A single value of either TRUE or FALSE
c)
A piece of code that you can easily call over and over again.
d)
Finding and fixing problems in your algorithm or program.
14.
Debugging
a)
Finding and fixing problems in your algorithm or program.
b)
Statements that only run under certain conditions.
c)
Any valid unit of code that resolves to a value.
d)
Part of a program that does not work correctly.
15.

Two functions in a single program can have different names but contain identical code.

a)

True

b)

False

16.

The way that sprites' properties are used in Game Lab, by connecting the sprite and property with a dot.

a)

Dot Notation

b)

Declare Command

c)

Initialize

d)

Variable

17.

By chance, not planned or prearranged; irregular

a)

variable

b)

random

c)

property

d)

sprite

18.

True or False .The following is a valid label name.


size_of _eye

a)

True

b)

False

19.

True or False. The following is a valid label name.


petalsize

a)

True

b)

False

20.

How can we correct the code above? We are getting the error message (dessert is defined, but it is not called in your program)

a)

Change drink to dessert in the 6th line of code

b)

Change drink to ice cream in the 6th line of code

c)

Change drink to sprite in the 6th in of code

21.

Which of the following is a correct example of a counter pattern?

a)

sprite.scale = 10

b)

sprite.x = sprite.x + 10

c)

sprite.rotation = .5

22.

If you wanted to make a sprite twice as big as it currently looks which code would you use?

a)

sprite.y

b)

sprite.scale

c)

sprite.rotation

d)

sprite.setAnimattion

23.

What keyboard key do you need press to move the sprite?

a)

x

b)

y

c)

up arrow

d)

space

24.

Which direction will the sprite move in the code pictured? (Click on picture to enlarge.)

a)

Left

b)

Right

c)

Up

d)

Down

25.

The code in the image is an example of

a)

an IF Statement

b)

a DrawLoop

c)

the counter pattern

d)

reducing the size of a sprite

26.

What is the NAME and starting Y LOCATION of this sprite?

a)

dog, 150

b)

dog, 350

c)

fido, 150

d)

fido, 350

27.

In which direction will the sprite move?

bee.y = bee.y - 2

a)

left

b)

right

c)

up

d)

down

28.

What is width of the rectangle in the following code?

rect(250, 200, 75, 225);

a)

250

b)

200

c)

75

d)

225

29.

Which sprite property would you change to make the sprite turn in a circle?

a)

sprite.x

b)

sprite.y

c)

sprite.scale

d)

sprite.rotation

30.

What is the (x, y) location of the palette?

a)

(0, 0)

b)

(200, 200)

c)

(100, 300)

d)

(300, 100)

e)

error

31.

Compare the rotation of the top row to the bottom row.

What is the rotation of the green car?


Definition: sprite.rotation = #;

Clockwise rotation in degrees of the sprite.

A positive value will rotate clockwise, a negative value will rotate counterclockwise. The rotation usually will be a number between -360 and 360.

a)

car.rotation = 0;

b)

car.rotation = 90;

c)

car.rotation = 180;

d)

car.rotation = 270;

e)

car.rotation = 360;

32.

Compare the rotation of the top row to the bottom row.

What is the rotation of the orange car?


Definition: sprite.rotation = #;

Clockwise rotation in degrees of the sprite.

A positive value will rotate clockwise, a negative value will rotate counterclockwise. The rotation usually will be a number between -360 and 360.

a)

car.rotation = 0;

b)

car.rotation = 90;

c)

car.rotation = -90;

d)

car.rotation = 270;

e)

car.rotation = -270;

33.

What is cowSmall.scale=?


var cowBig = createSprite(150, 150);

cowBig.setAnimation("cow");

cowBig.scale = 1;

var cowSmall = createSprite(250, 250);

cowSmall.setAnimation("cow");

cowSmall.scale = ?;

a)

0.5

b)

1.0

c)

1.5

d)

2.0

e)

None of the above

34.

What is cowSmall.scale=?


var cowBig = createSprite(150, 150);

cowBig.setAnimation("cow");

cowBig.scale = 1;

var cowSmall = createSprite(250, 250);

cowSmall.setAnimation("cow");

cowSmall.scale = ?;

a)

0.5

b)

1.0

c)

1.5

d)

2.0

e)

None of the above

35.

What is fishBlue.scale=?


var fishGold = createSprite(100, 100);

fishGold.setAnimation("fish");

fishGold.tint='gold';

fishGold.scale = 1.0;


var fishBlue = createSprite(200, 200);

fishBlue.setAnimation("fish");

fishBlue.tint='blue';

fishBlue.scale = ?;

a)

0.5

b)

1.0

c)

2.0

d)

None of the above

36.

Which car is going up (to the top of the screen)?

a)

blue

b)

green

c)

red

d)

yellow

e)

none of the above

37.

Which car is going to the left?

a)

blue

b)

green

c)

red

d)

yellow

e)

none of the above

38.

Select the statements that are needed to move the mouse diagonally from the right top corner to the left bottom corner.

a)

mouse.x = mouse.x + 2;

b)

mouse.x = mouse.x - 2;

c)

mouse.y = mouse.y + 2;

d)

mouse.y = mouse.y - 2;

39.

Select the statements that are needed to move the mouse diagonally from the right bottom corner to the left top corner.

a)

mouse.x = mouse.x + 2;

b)

mouse.x = mouse.x - 2;

c)

mouse.y = mouse.y + 2;

d)

mouse.y = mouse.y - 2;

40.

Select the statement for the pan to rotate clockwise.

a)

pan.x = pan.x - 1

b)

pan.rotation = pan.rotation - 1

c)

pan.rotation = pan.rotation + 1

d)

pan.x = pan.x + 1

41.

Which fish is swimming the fastest?

a)

orangeFish.x = orangeFish.x - 2

b)

blueFish.x = blueFish.x - 3

c)

greenFish.x = greenFish.x - 1

d)

Cannot be determined

42.

If I wanted Franklyn to be a mermaid with orange hair, will Franklyn appear that way?

a)

Yes, I did everything I should.

b)

No, Franklyn is supposed to be a green monster.

c)

Yes, but Franklyn will have purple hair.

d)

No, I forgot to assign an animation to my sprite.

43.

Where will Franklyn appear? (All options have Franklyn represented as a square.)

a)
b)
c)
d)
44.

This code will draw a pink monster. Which of the pictures is drawn correctly?

a)
b)
c)
d)
45.

What are the rules you need to follow when naming variables?

a)

Labels cannot include spaces. Labels cannot begin with a number.

b)

Labels cannot include spaces. Labels cannot begin with a number. Be very careful with spelling. Labels are case sensitive.

c)

Labels are case-sensitive. Labels need to be spelled correctly.

d)

Labels should be in camel case. Labels should be spelled correctly. Labels cannot begin with a number.

46.

Which of these has the x axis labeled correctly?

a)
b)
47.

What is the center of my grid?

a)

(0, 0)

b)

(400, 400)

c)

(200, 200)

d)

(250, 250)

48.

Which of these pictures best captures the overall shape of the ellipse in this code?

a)
b)
c)
d)
49.

Which of the numbers represents the height of the ellipse?

a)

200

b)

100

c)

300

d)

150

50.

What direction would the following code move in?

bird.velocityX = -5

a)

up

b)

left

c)

right

d)

it doesn't move

51.

What direction would the following code move in?

bird.velocityY = -5

a)

up

b)

down

c)

left

d)

right

e)

it doesn't move

52.

What direction would the following code move in?

bird.velocityY = 5

bird.velocityX = 5

a)

up and left

b)

down and left

c)

down and right

d)

up and right

53.

What is the initial value for rotationSpeed?

a)

180

b)

0

c)

1

d)

360

54.

What is the initial value for velocityX?

a)

60

b)

1

c)

0

d)

-1

55.

A sprite named bird is moving to the right at a rapid speed. What block would you use to get the bird to stop moving?

a)

bird.rotationSpeed = 0

b)

bird.velocityX = 0

c)

bird.velocityY = 0

d)

bird.Y = 0

56.

To make a sprite rotate at a speed of 3 degrees,

you would use the block:

sprite.rotationSpeed = _? Fill in the blank

(a)  

57.

What direction would the following code move in?

bird.velocityY = 5

bird.velocityX = -5

a)

up and left

b)

down and left

c)

down and right

d)

up and right

58.

In the code below, what is the condition?

a)

bee.velocityX = -5

b)

if

c)

bee.x > 200

d)

bee.velocityX = 5

59.

In the code below, when does the bee move to the left?

a)

When bee.x = 100

b)

When bee.x = 0

c)

When bee.x = 300

d)

When bee.x = 200

60.

In the code below, when does the bee move to the right?

a)

When bee.x = 100

b)

When bee.x = 0

c)

When bee.x = 300

d)

When bee.x = 200

61.

What direction would the following code move in?

bird.velocityX = 0

a)

up

b)

down

c)

left

d)

right

e)

it wouldn't move

62.
a)

The car goes right.

and is speeding up.

b)

The car goes right.

and is slowing down.

c)

The car goes right, slows down and then goes backward.

d)

The car goes right, slows down and then stops.

63.
a)

The car goes right.

and is speeding up.

b)

The car goes right.

and is slowing down.

c)

The car goes right, slows down and then goes backward.

d)

The car goes right, slows down and then stops.

64.
a)

The car goes left, slows down and stops.

b)

The car goes right, slows down and stops.

c)

The car goes down, slows down and stops.

d)

The car goes up, slows down and stops.

65.

Makes the sprite push the target as long as they are touching each other. The sprite keeps moving normally.

a)

sprite.displace(tgt);

b)

sprite.collide(tgt);

c)

sprite.bounce(tgt);

d)

sprite.bounceOff(tgt);

66.

Makes the sprite stop when it runs into the target. If the target is moving, it will push the sprite with it. The target keeps moving as before.

a)

sprite.displace(tgt);

b)

sprite.collide(tgt);

c)

sprite.bounce(tgt);

d)

sprite.bounceOff(tgt);

67.

Makes the sprite and the target bounce when they touch each other. Both the sprite and the target change how they are moving.

a)

sprite.displace(tgt);

b)

sprite.collide(tgt);

c)

sprite.bounce(tgt);

d)

sprite.bounceOff(tgt);

68.

Makes the sprite bounce off the target when they touch each other. The target keeps moving as before.

a)

sprite.displace(tgt);

b)

sprite.collide(tgt);

c)

sprite.bounce(tgt);

d)

sprite.bounceOff(tgt);

69.

What is the start and stop for the red arc?


Hint: For both angles, 0 degrees is to the right. 90 degrees is down. 180 degrees is to the left. 270 degrees is up. The arc is always drawn clockwise from wherever start falls to wherever stop falls on the ellipse.

a)

arc(x, y, w, h, 180, 270);

b)

arc(x, y, w, h, 270, 0);

c)

arc(x, y, w, h, 0, 90);

d)

arc(x, y, w, h, 90, 180);

70.

What is the start and stop for the green arc?


Hint: For both angles, 0 degrees is to the right. 90 degrees is down. 180 degrees is to the left. 270 degrees is up. The arc is always drawn clockwise from wherever start falls to wherever stop falls on the ellipse.

a)

arc(x, y, w, h, 180, 270);

b)

arc(x, y, w, h, 270, 0);

c)

arc(x, y, w, h, 0, 90);

d)

arc(x, y, w, h, 90, 180);

71.

What is the start and stop for the blue arc?


Hint: For both angles, 0 degrees is to the right. 90 degrees is down. 180 degrees is to the left. 270 degrees is up. The arc is always drawn clockwise from wherever start falls to wherever stop falls on the ellipse.

a)

arc(x, y, w, h, 180, 270);

b)

arc(x, y, w, h, 270, 0);

c)

arc(x, y, w, h, 0, 90);

d)

arc(x, y, w, h, 90, 180);

72.

What is the start and stop for the yellow arc?


Hint: For both angles, 0 degrees is to the right. 90 degrees is down. 180 degrees is to the left. 270 degrees is up. The arc is always drawn clockwise from wherever start falls to wherever stop falls on the ellipse.

a)

arc(x, y, w, h, 180, 270);

b)

arc(x, y, w, h, 270, 0);

c)

arc(x, y, w, h, 0, 90);

d)

arc(x, y, w, h, 90, 180);

73.

Identify the statement for the red arc.

a)

arc(400, 0, 200, 200, 90, 180);

b)

arc(0, 400, 200, 200, 270, 0);

c)

arc(0, 0, 200, 200, 0, 90);

d)

arc(400, 400, 200, 200, 180, 270);

74.

Identify the statement for the yellow arc.

a)

arc(400, 0, 200, 200, 90, 180);

b)

arc(0, 400, 200, 200, 270, 0);

c)

arc(0, 0, 200, 200, 0, 90);

d)

arc(400, 400, 200, 200, 180, 270);

75.

Identify the statement for the blue arc.

a)

arc(400, 0, 200, 200, 90, 180);

b)

arc(0, 400, 200, 200, 270, 0);

c)

arc(0, 0, 200, 200, 0, 90);

d)

arc(400, 400, 200, 200, 180, 270);

76.

Identify the statement for the green arc.

a)

arc(400, 0, 200, 200, 90, 180);

b)

arc(0, 400, 200, 200, 270, 0);

c)

arc(0, 0, 200, 200, 0, 90);

d)

arc(400, 400, 200, 200, 180, 270);

77.

Which of the following is not one of the purposes of having potential users test a program or app?

a)

To write the code for the program/app.

b)

To see if there are any bugs in the program/app.

c)

To get input on the design of the program/app.

d)

To see how a user interacts with the app/program.

78.

Which line of code is most likely to return an error?

a)

1

b)

2

c)

3

d)

4

79.

What is a reason to include comments in a program?

a)

Comments tell the computer what the code is doing.

b)

Comments tell the programmer what the code is doing.

c)

Comments help the user work an app more effectively.

d)

Comments will show up in the console so when the program is run, the programmer know what happens.

80.

What code do we add to make the elephant push the hippo off the screen?

a)
b)
c)
d)