wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Variable and Serial communication

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

What is a variable?

a)

A function to repeat the program many times

b)

Types of storage

c)

Storage locations with names that hold data

d)

A function to pause the program

2.

Can a variable hold different types of data?

a)

Yes

b)

No

3.

How do we set the types of data the variable holds?

a)

Using data types

b)

Using a loop

c)

Using Serial.print

d)

Using pinMode

4.

Can we give any name to a variable?

a)

Yes

b)

No

5.

What does int stands for in programming?

a)

initial

b)

integer

c)

integrity

d)

interval

6.

What is an integer?

a)

Alphabets

b)

Numbers with decimal points

c)

Numbers without decimal points

d)

Sentences

7.

If you have a variable that stores the value "3", which data type is this?

a)

int

b)

float

c)

double

d)

string

8.

int number = 3;

Is this the correct way to declare a variable?

a)

Yes

b)

No

9.

What is a float in programming?

a)

Alphabets

b)

Numbers with decimal points

c)

Numbers without decimal points

d)

Sentences

10.

If you have a variable that stores the value "3.142", which data type is this?

a)

int

b)

float

c)

double

d)

string

11.

float number = 3.142;

Is this the correct way to declare a variable?

a)

Yes

b)

No

12.

What is a double in programming?

a)

Alphabets

b)

Numbers with long decimal points

c)

Numbers without decimal points

d)

Sentences

13.

If you have a variable that stores the value "3.142 e20", which data type is this?

a)

int

b)

float

c)

double

d)

string

14.

double number = 3.142 e 20;

Is this the correct way to declare a variable?

a)

Yes

b)

No

15.

What is a char in programming?

a)

Alphabets

b)

Numbers with long decimal points

c)

Numbers without decimal points

d)

Sentences

16.

What does char stands for in programming?

a)

chart

b)

charge

c)

character

d)

char keow teow

17.

If you have a variable that stores the value "B", which data type is this?

a)

char

b)

float

c)

double

d)

string

18.

char alphabet = "D";

Is this the correct way to declare a variable?

a)

Yes

b)

No

19.

What is a string in programming?

a)

Alphabets

b)

Numbers with long decimal points

c)

Numbers without decimal points

d)

Sentences

20.

If you have a variable that stores the value "Hello world", which data type is this?

a)

char

b)

float

c)

double

d)

string

21.

string sentence = "Hello world";

Is this the correct way to declare a variable?

a)

Yes

b)

No

22.

Can you use Arduino to print texts?

a)

Yes

b)

No

23.

How many basic functions are required to write texts with Arduino?

a)

1

b)

2

c)

3

d)

4

24.

What is the function of Serial.begin ()

a)

Pauses the program

b)

Prints out texts

c)

Sets the transmission speed

25.

What is the commonly used transmission speed?

a)

9600

b)

115200

c)

14400

d)

31250

26.

Which function do you use to print out texts?

a)

Serial.begin ()

b)

Serial.read()

c)

Serial.print()

27.

Serial.print ("Hi everyone");

What is the output of this program?

a)

Hi

b)

Serial.print

c)

Hi everyone

d)

everyone

28.

Serial.print("Hi");

Serial.print ("everyone");

What is the output of this program?

a)

Hi

everyone

b)

Hieveryone

c)

Hi everyone

29.

Serial.println("Hi");

Serial.println("everyone");

What is the output of this program?

a)

Hieveryone

b)

Hi everyone

c)

Hi

everyone

30.

Which function prints out texts in a new line?

a)

Serial.print()

b)

Serial.println()

c)

Serial.begin()

d)

Serial.read()