CP1 - 4.01 - Understanding Variables Naming Conventions Question Preview (ID: 43597)


Understanding Variables Naming Conventions. TEACHERS: click here for quick copy question ID numbers.

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

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

Jayce wants to store the student name “Ellen” in a variable. Which data type should he use?
a) Double
b) Integer
c) Char
d) String

Using the statement below, what is the initial value of this variable? Dim intHours As Integer
a) 0
b) 1
c) Empty
d) Nothing

Hugh declares a variable in the event procedure code for a button. What scope is this variable?
a) Procedural
b) Global
c) Local
d) Non-Local

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
d)

If you assign a number such as 3.768 to a double variable, what will be stored in the memory location?
a) 0
b) 3
c) 3.768
d) 4

Which data type is used to declare a variable that will store the value 0.113?
a) Char
b) Double
c) Boolean
d) String

Which is written in Hungarian Notation?
a) decAmountDue
b) EXIT_BUTTON
c) EXITBUTTON
d) last_name_txt_box

The most appropriate data type for the word “Value” is:
a) decimal
b) double
c) integer
d) string

Which method formats output as currency?
a) dblMoney.ToString(''$##.00'')
b) dblMoney.ToString($##.00)
c) dblMoney.ToString= $##.00
d) dblMoney.ToString= ''$##.00

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))

How do you declare a variable whose value cannot be changed after assignment?
a) Replace Dim with Const
b) Replace Dim with Static
c) Declare the variable as a global variable
d) Add Const after Dim

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) Integer
c) Decimal
d) String

Which data type is appropriate to store the number five (5)?
a) Boolean
b) Integer
c) Char
d) String

Susan declares a variable within an If statement. What is the scope of this variable?
a) Procedural
b) Global
c) Local
d) Non-Local

What data type is returned from a text box control?
a) String
b) Integer
c) Double
d) Boolean

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

Variable names:
a) can be a keyword.
b) can contain spaces.
c) must begin with a letter.
d) must contain a digit.

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) 3.7
d) 4

Play Games with the Questions above at ReviewGameZone.com
To play games using the questions from above, visit ReviewGameZone.com and enter game ID number: 43597 in the upper right hand corner or click here.

TEACHERS / EDUCATORS
Log In
| Sign Up / Register