wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Code.org Discoveries Conditional Blocks

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Predict what will show up on console.log

a)

true true true

b)

true false false

c)

false false false

d)

true false true

2.

What happens if you don't call background in your draw loop and your sprite has movement?

a)

nothing, animation is fine.

b)

the sprites are drawn on top of each other to simulate movement, the older drawings don't get erased.

c)

you don't need to call background because you don't have one.

d)

you can just use sprite.move( ) so there's no need for the function background( )

3.

In the draw loop, if you call the text function before the drawSprites and/or background function, what happens?

a)

You won't be able to see your text because the sprites and background will be drawn on top of the text.

b)

You will be able to see your text because Game Lab knows you want to see the text.

c)

You won't be able to see your sprites or background because order doesn't matter.

d)

You will be able to see your text because the sprites and the background will be drawn after the text.

4.

the if(keyDown(up)) returns

a)

a boolean value of true if the user presses the down key

b)

a boolean value of false if the user presses the down key

c)

A boolean value of true if the user presses the up key

d)

A boolean value of false if the user presses the up key

5.
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.
6.
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.
7.
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.
8.
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.
9.

Conditionals let your program

a)

Repeat code to increase efficiency

b)

Make decisions to follow a different path

c)

Run in the right order

d)

Give a set of commands a custom name

10.

In this scenario it is raining. Is the conditional true or false and what will we do in this scenario.

a)

true, we will stay indoors

b)

true, we will go outside

c)

false, we will stay indoors

d)

false, we will go outside

11.

The isTouching block may be new to you but if it works in if-then statements as the condition, then it must return a ______.

a)

Boolean

b)

String

c)

Number

d)

Bovine

12.

Which key makes the player move to the right?

a)

The left arrow key

b)

The right arrow key

c)

Neither

13.

Which values stored in lives would cause the gameOver sprite to become visible?

a)

1

b)

2

c)

3

d)

-2

e)

0

14.

Is the boolean expression on line 14 currently true or false?

a)

True

b)

False

15.

Is the boolean expression on line 14 currently true or false?

a)

True

b)

False

16.

Is the boolean expression on line 14 currently true or false?

a)

True

b)

False

17.

Oh no! This code is all messed up! Read the code carefully. Which direction will the sprite go if the up arrow is pressed?

a)

Up

b)

Down

c)

Left

d)

Right

18.

Oh no! This code is all messed up! Read the code carefully. Which direction will the sprite go if the down arrow is pressed?

a)

Up

b)

Down

c)

Left

d)

Right

19.

Which of these increases the values of clicks when the space key has been released?

a)
b)
c)
d)
20.

Which of these places an incorrect block into the condition for the if statement?

a)
b)
c)
d)