Review Game Zone
Flash Cards
(current)
Games
Teachers
Search
CP1 - 4.01 - Understanding Variables Naming Conventions
Test Description: Understanding Variables Naming Conventions
Instructions: Answer all questions to get your test result.
1) John needs a variable to hold its value beyond its normal lifetime. What type of variable should he use?
A
Const
B
Double
C
Integer
D
Static
2) 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
Procedural
B
Non-Local
C
Local
D
Global
3) Jayce wants to store the student name “Ellen” in a variable. Which data type should he use?
A
String
B
Double
C
Integer
D
Char
4) Using the statement below, what is the initial value of this variable? Dim intHours As Integer
A
1
B
Empty
C
0
D
Nothing
5) Hugh declares a variable in the event procedure code for a button. What scope is this variable?
A
Local
B
Global
C
Non-Local
D
Procedural
6) What value does the statement intWeight=Convert.toInt32(txtWeight.Text) return if the value keyed by the user was 47?
A
47
B
0
C
forty-seven
7) If you assign a number such as 3.768 to a double variable, what will be stored in the memory location?
A
3
B
0
C
3.768
D
4
8) Which data type is used to declare a variable that will store the value 0.113?
A
String
B
Boolean
C
Char
D
Double
9) Which is written in Hungarian Notation?
A
last_name_txt_box
B
EXIT_BUTTON
C
EXITBUTTON
D
decAmountDue
10) The most appropriate data type for the word “Value” is:
A
double
B
string
C
decimal
D
integer
11) Which method formats output as currency?
A
dblMoney.ToString($##.00)
B
dblMoney.ToString= ''$##.00
C
dblMoney.ToString= $##.00
D
dblMoney.ToString(''$##.00'')
12) What is the correct code to create a message box from the following code? lblcost.Text= The cost of the product is: (deccost + dectax)
A
MessageBox.Show (The cost of the product is: (deccost + dectax))
B
MessageBox.Show The cost of the product is: (deccost + dectax)
C
Textbox.show =(The cost of the product is: (deccost + dectax))
D
Textbox.Show (The cost of the product is: (deccost + dectax))
13) How do you declare a variable whose value cannot be changed after assignment?
A
Declare the variable as a global variable
B
Replace Dim with Static
C
Replace Dim with Const
D
Add Const after Dim
14) The words “A Double data type should be always stored as a Double data type!” would be best stored in which data type?
A
Double
B
String
C
Integer
D
Decimal
15) Which data type is appropriate to store the number five (5)?
A
Boolean
B
String
C
Integer
D
Char
16) Susan declares a variable within an If statement. What is the scope of this variable?
A
Procedural
B
Non-Local
C
Local
D
Global
17) What data type is returned from a text box control?
A
Double
B
String
C
Integer
D
Boolean
18) 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
Static Dim intGrade As Integer
C
Dim intGrade As Integer
D
Dim Static intGrade As Integer
19) Variable names:
A
can be a keyword.
B
must contain a digit.
C
must begin with a letter.
D
can contain spaces.
20) If you assign a number, such as 3.7, to an integer variable, what will be stored in the memory location?
A
4
B
3.7
C
3
D
0
*select an answer for all questions
Check Results & Get Answers
Play Games with the Questions Above
Teachers: Create FREE classroom games with your questions
Click for more info!
©2007-2024
ReviewGameZone.com
|
About
|
Privacy
|
Contact
|
Terms
|
Site Map
WAIT! Find what you needed?
×
Still Looking for the Answers?
Have Another Question?
Play a Review Game with These Questions?
Want to Make Your Own Test Like This One?