wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Coding: Variables

Total questions: 12

Worksheet time: 12mins

Name
Class
Date
1.

For the following pseudocode:

takeoff;

if (Alexa said Hello),

I say "Stop Alexa"

else

I say "Hi Alexa"


If my Alexa says "Good Morning", what will I say?

a)

Stop Alexa

b)

Hi Alexa

c)

Good Morning, Alexa

d)

Nothing

2.

For the following pseudocode:


set number to 2;

if (get number is 8)

flip forward;

else if (get number is 2)

flip right;

else

flip backwards;


What will my drone do?

a)

flip backwards

b)

flip forward

c)

flip right

d)

nothing

3.

For the following pseudocode:


set number to 10;

if (get number is 8)

flip forward;

else if (get number is 2)

flip right;

else

flip backwards;


What will my drone do?

a)

flip backwards

b)

flip forward

c)

flip right

d)

nothing

4.

For the following pseudocode:


set distance to 1;

go forward for (get distance) seconds;

change distance by 1;

go forward for (get distance) seconds;

change distance by -1;


What is my distance in the end?

a)

1

b)

2

c)

3

d)

4

5.

For the following pseudocode:


set distance to 1;

go forward for (get distance) seconds;

change distance by 1;

go forward for (get distance) seconds;

change distance by -1;


What is my distance in the beginning?

a)

1

b)

2

c)

3

d)

4

6.

A variable is used to...

a)

tell if an expression is true or false

b)

repeat the same instructions over and over again

c)

store information to be referenced and used by programs

d)

store information so that it is never used in the program

7.

In the game of Pacman, what is an example of a variable?

a)

Pacman

b)

Lives

c)

Time

d)

All of the above

8.

In Basketball, what are good variables?

a)

Score

b)

If the team wins

c)

If the team loses

d)

Whether the team listens to the coach

9.

Code is...

a)

when it's not warm.

b)

the dog from Garfield.

c)

a song or poem dedicated to someone.

d)

specific instructions in a computer program.

10.

Statements that can only run under certain conditions or situations such as: if the seat is taken, then move to the next available seat.

a)

conditionals (if/then statements)

b)

variable

c)

abstractions

d)

binary

11.

A letter or symbol to which a some value can be assigned.

a)

Print

b)

Variable

c)

Output

d)

Bug

12.

What is a condition?

a)

JavaScript

b)

Something that has to be true in order for an action to be carried out.

c)

syntax

d)

pseudocode