NEW
Font size
S
M
L
XL
WorksheetsCPI: Chapter 3 Variable
Total questions: 16
Worksheet time: 8mins
Name
Class
Date
1.
Which is written in Hungarian Notation?
a)
decAmountDue
b)
EXIT_BUTTON
c)
EXITBUTTON
d)
last_name_txt_box
2.
The most appropriate data type for the word "Value" is:
a)
Decimal
b)
Double
c)
Integer
d)
String
3.
Which data type is appropriate to store the number five (5)?
a)
Boolean
b)
Integer
c)
Char
d)
String
4.
John needs a variable to hold its value beyond its normal lifetime. What type of variable should he use?
a)
Static
b)
Const
c)
Integer
d)
Double
5.
If you assign a number, such as 3.7, to an integer variable, what will be stored in the memory location?
a)
0
b)
3
c)
5
d)
4
6.
What data type is returned from a text box control?
a)
Integer
b)
String
c)
Double
d)
Boolean
7.
Which data type is used to declare a variable that will store the value 0.113?
a)
Char
b)
Double
c)
Boolean
d)
String
8.
Kirk wants to declare a variable that holds its value beyond the normal lifetime. How should he declare it?
a)
Static intGrade As Integer
b)
Dim Static intGrade As Integer
c)
Static Dim intGrade As Integer
d)
Dim intGrade As Integer
9.
Josie is writing a program and needs a variable that can be accessed from multiple event procedures. What scope of variable should she use?
a)
Global
b)
Procedural
c)
Local
d)
Non-Local
10.
A variable named decBonus is of what data type?
a)
Boolean
b)
Double
c)
Decimal
d)
String
11.
Variable names:
a)
Can be a keyword
b)
Can contain spaces
c)
Must contain a digit
d)
Must begin with a letter
12.
Which would be appropriate as a variable?
a)
#HoursWorked
b)
$PayRate
c)
Last.Name
d)
strFirstName
13.
Why is a label NOT a valid variable name?
a)
It does not start with a number.
b)
It does not have underscore as one of its characters.
c)
It is a Visual Basic reserved keyword.
d)
It should be at least 6 characters.
14.
Which would be appropriate as an object name?
a)
9DigitZip
b)
GrossPay$
c)
Last.name
d)
txtHoursWorked
15.
Susan declares a variable within an IF statement. What is the scope of this variable?
a)
Procedural
b)
Global
c)
Local
d)
Non-Local
16.
Which data type is appropriate to store the value 75.9?
a)
Boolean
b)
Double
c)
Integer
d)
String
Reset
