Font size
WorksheetsVariables
Total questions: 15
Worksheet time: 10mins
Which of the following is NOT a correct variable name?
a. 3three
b. gender
c. yourFirstname
d. age
Which of the following is NOT a correct variable name?
a. Num1
b. 1stQtr
c. Num_1
d. firstQtr
Which data type is use to store “D”?
a. float
b. character
c. boolean
d. string
Which of the following is NOT part of a variable?
a. name
b. number
c. type
d. value
In C++ program, which one of the following is a correct variable declaration?
a. int name;
b. double 1stnum;
c. float = 2.22;
d. none of the above
Which data type is use to store “HELLO WORLD!”?
a. character
b. integer
c. boolean
d. string
Which of the following is NOT correct about variable?
a. variables are use for storing values.
b. Once a variable is declared, it cannot be changed.
c. a variable is essential in programming
d. a variable should be declared first before it can be used.
What type of data that returns a value either true or false.
a. float
b. integer
c. string
d. boolean
What is the name of this variable?
string sum = “input an integer”;
a. sum
b. string
What is the name of this variable?
string response="input a string";
a. string
b. response
What is a variable?
a. something that cannot be change
b. a storage location with a unique name and a data type.
c. something that can store numbers only.
d. a name that can be used in programming.
A. Based on the program code in Activity 2. What are the values hold by the following variables?
1. variable a.
(a)
A. Based on the program code in Activity 2. What are the values hold by the following variables?
1. variable b
(a)
A. Based on the program code in Activity 2. What are the values hold by the following variables?
1. variable number
(a)
A. Based on the program code in Activity 2. What are the values hold by the following variables?
1. variable c
(a)
