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
Static
D
Integer
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
Global
C
Local
D
Non-Local
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
0
B
1
C
Nothing
D
Empty
5) Hugh declares a variable in the event procedure code for a button. What scope is this variable?
A
Local
B
Procedural
C
Non-Local
D
Global
6) What value does the statement intWeight=Convert.toInt32(txtWeight.Text) return if the value keyed by the user was 47?
A
forty-seven
B
47
C
0
7) If you assign a number such as 3.768 to a double variable, what will be stored in the memory location?
A
0
B
4
C
3.768
D
3
8) Which data type is used to declare a variable that will store the value 0.113?
A
Char
B
Boolean
C
Double
D
String
9) Which is written in Hungarian Notation?
A
EXIT_BUTTON
B
last_name_txt_box
C
decAmountDue
D
EXITBUTTON
10) The most appropriate data type for the word “Value” is:
A
integer
B
decimal
C
double
D
string
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
Textbox.Show (The cost of the product is: (deccost + dectax))
C
Textbox.show =(The cost of the product is: (deccost + dectax))
D
MessageBox.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 Const
C
Replace Dim with Static
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
String
B
Decimal
C
Integer
D
Double
15) Which data type is appropriate to store the number five (5)?
A
Char
B
Boolean
C
Integer
D
String
16) Susan declares a variable within an If statement. What is the scope of this variable?
A
Procedural
B
Global
C
Non-Local
D
Local
17) What data type is returned from a text box control?
A
String
B
Double
C
Boolean
D
Integer
18) Kirk wants to declare a variable that holds its value beyond the normal lifetime. How should he declare it?
A
Dim Static intGrade As Integer
B
Static intGrade As Integer
C
Static Dim intGrade As Integer
D
Dim intGrade As Integer
19) Variable names:
A
must begin with a letter.
B
can contain spaces.
C
must contain a digit.
D
can be a keyword.
20) If you assign a number, such as 3.7, to an integer variable, what will be stored in the memory location?
A
0
B
4
C
3
D
3.7
*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?