wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Variables and Data Types

Total questions: 16

Worksheet time: 8mins

Name
Class
Date
1.

What data type to store a mobile phone number?

a)

float

b)

integer

c)

string

2.

Which of the following is a valid variable name in JavaScript?

a)

1number

b)

html

c)

number

d)

*number

3.

What is the result of "80" + 71.2?

a)

151.2

b)

151

c)

"8071.2"

4.

What data type to store the price of a CD?

a)

boolean

b)

float

c)

string

d)

integer

5.

What data type to store a postcode: IP4 5HD?

a)

boolean

b)

float

c)

integer

d)

string

6.

5Price is a valid variable name in JavaScript.

a)

true

b)

false

7.

A declared variable without assigning any value to it is called Null.

a)

true

b)

false

8.

If you add a string and a number, the result will be a number.

a)

true

b)

false

9.

Below is an example of how you will declare a variables in one single line .

Var month=”July”; date=3; year= 2019;

a)

true

b)

false

10.

After execution of the following code, the value of G10 is Red?

var G10 = “green”;

var G7 = “yellow”;

var G8 = “blue”;

var G9 = “red”;

G7=G10;

G9 = G7;

G8=G9;

G10=G8;

a)

true

b)

false

11.

The Ternary operator is represented by an exclamation (!).

a)

true

b)

false

12.

Which of the following is Booleans?

a)

true

b)

"true"

c)

"false"

13.

What is the result of 2 * “4”?

a)

8

b)

24

c)

6

14.

What data type is used for: age = 15?

a)

Boolean

b)

String

c)

Integer

d)

Boolean

15.

What data type would you use to store your Date of Birth?

a)

Boolean

b)

String

c)

Date

d)

Integer

16.

What data type to store a credit card number?

a)

Boolean

b)

String

c)

Integer

d)

Float