wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Variables Warm Up

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

What type of variable is 5

a)

String

b)

Boolean

c)

Integer

d)

Float

2.

What type of variable is "peanut butter"?

a)

String

b)

Boolean

c)

Integer

d)

Float

3.

What type of variable is -7?

a)

String

b)

Boolean

c)

Integer

d)

Float

4.

What type of variable is 8.9?

a)

String

b)

Boolean

c)

Integer

d)

Float

5.

What type of variable is false?

a)

String

b)

Boolean

c)

Integer

d)

Float

6.

Which is correct?

a)

var 8ballLocation;

b)

var EightBallLocation;

c)

var eightballLocation;

d)

var eightBallLocation;

7.

Which is correct?

a)

printLn

b)

println

c)

printIn

d)

printin

8.

What keyword do you need to use to define/initialize a variable?

a)

variable

b)

int

c)

x

d)

var

9.

What does this print to the computer?

var pet = "dogs'

var numOfPets = 3


println("I have " + numOfPets+ " " + pet)

4 lines
10.

What does this print to the computer?

var pet = "dogs'

var numOfPets = 3


println("I have " + numOfPets+ " " + pet)


pet = "cat"

numOfPets = 1


println("My friend has" + numOfPets + " " + pet)

4 lines