WorksheetsVariable and Serial communication
Total questions: 30
Worksheet time: 15mins
What is a variable?
A function to repeat the program many times
Types of storage
Storage locations with names that hold data
A function to pause the program
Can a variable hold different types of data?
Yes
No
How do we set the types of data the variable holds?
Using data types
Using a loop
Using Serial.print
Using pinMode
Can we give any name to a variable?
Yes
No
What does int stands for in programming?
initial
integer
integrity
interval
What is an integer?
Alphabets
Numbers with decimal points
Numbers without decimal points
Sentences
If you have a variable that stores the value "3", which data type is this?
int
float
double
string
int number = 3;
Is this the correct way to declare a variable?
Yes
No
What is a float in programming?
Alphabets
Numbers with decimal points
Numbers without decimal points
Sentences
If you have a variable that stores the value "3.142", which data type is this?
int
float
double
string
float number = 3.142;
Is this the correct way to declare a variable?
Yes
No
What is a double in programming?
Alphabets
Numbers with long decimal points
Numbers without decimal points
Sentences
If you have a variable that stores the value "3.142 e20", which data type is this?
int
float
double
string
double number = 3.142 e 20;
Is this the correct way to declare a variable?
Yes
No
What is a char in programming?
Alphabets
Numbers with long decimal points
Numbers without decimal points
Sentences
What does char stands for in programming?
chart
charge
character
char keow teow
If you have a variable that stores the value "B", which data type is this?
char
float
double
string
char alphabet = "D";
Is this the correct way to declare a variable?
Yes
No
What is a string in programming?
Alphabets
Numbers with long decimal points
Numbers without decimal points
Sentences
If you have a variable that stores the value "Hello world", which data type is this?
char
float
double
string
string sentence = "Hello world";
Is this the correct way to declare a variable?
Yes
No
Can you use Arduino to print texts?
Yes
No
How many basic functions are required to write texts with Arduino?
1
2
3
4
What is the function of Serial.begin ()
Pauses the program
Prints out texts
Sets the transmission speed
What is the commonly used transmission speed?
9600
115200
14400
31250
Which function do you use to print out texts?
Serial.begin ()
Serial.read()
Serial.print()
Serial.print ("Hi everyone");
What is the output of this program?
Hi
Serial.print
Hi everyone
everyone
Serial.print("Hi");
Serial.print ("everyone");
What is the output of this program?
Hi
everyone
Hieveryone
Hi everyone
Serial.println("Hi");
Serial.println("everyone");
What is the output of this program?
Hieveryone
Hi everyone
Hi
everyone
Which function prints out texts in a new line?
Serial.print()
Serial.println()
Serial.begin()
Serial.read()
