Quiz 3 Flashcards
The following statement is valid:
Dim x As Double = 3,542.36
False
If strVar.Length is 5, then the value of
strVar.Substring (4,1)
is the last character of the value of strVar
True
Visual Basic always displays numbers in decimal format
True
The exponential notation used in Visual Basic is exactly the same as standard mathematical notation
False
When declaring a variable type String, you must specify a length for the string
False
When declaring a variable that will refer to a submarine, a good name for the variable is sub
False
The function Math.Int will always round mixed numbers down to the next lowest integer
True
When using the equal sign to assign values, the variable on the left hand side of the equal sign will always receive the value
True
The variable firstName and firstNAME are identical
True
The following statement assigns 6 times the value of y to x:
x = 6y
False
The following statement is valid:
y = y + 72
True
A numeric variable that has not been assigned a value has the default value zero
True
The statement a + b = c assigns to c the sum of the values of a and b
False
The lstBox.Items.Clear() statement is used to empty the contents of a list box
True
An assignment statement is used to assign a value to a variable or property
True
You can use a variable name in almost any place you could use a literal value
True
Numeric variables can be initialized to zero or any other number, but once they are initialized, they cannot be changed
False
The following two statements are equivalent:
var1 = var2
var2 = var1
False
The value of (11mod2) is 1
True
The value of (11\2) is 1
False
The following two statements are equivalent, where numVar is a numeric variable:
numVar = numVar + 1
numVar += 1
True
The value of strVar.Length is the number of characters in the value of strVar
True
The following lines are valid:
Dim h As String = “Hello”
txtBox.Text = CStr(h.IndexOf(“h”))
True
All comment statements must be placed at the beginning of a program
False
The statement lstBox.Items.Add(“”) clears all text from the list box
False
The statement txtBox = “Hello” is an example of a syntax error
True
The following statement is valid where dog and cat are variables of the same type:
dog = cat
True
Option Explicit requires you to declare every variable before its use
True
With Option Strict On, a statement of the form
intVar = dblVar
is not valid.
True
A statement of the form
dblVar = intVar
is a narrowing assignment statement.
False
An assignment statement of the form
intVar = 8 / 4
is not valid
True
After the statement txtBox.Text = “” is executed, the text box will be clear and the
cursor will appear inside the text box
False
A string literal is a sequence of characters that is treated as a single entity
True
When declaring a variable of type String, you must specify a length for the string
False
Typecasting is used to convert a value to a different data type
True
The Trim method is used to remove all blank space before and after a string
True
The Substring method is used to extract a portion of a string
True
The empty string is the same as a string that contains one space
False
A variable declared inside an event procedure is said to have local scope
True
A variable declared outside of an event procedure is said to have class-level scope
True
A variable declared inside an event procedure cannot have the same name as a variable
declared inside another procedure
False
When a variable declared in one event procedure has the same name as a variable declared
in another event procedure, any change to the value of one of the variables will affect the
value of the other variable
False
The value of
(12345).ToString(“C”)
is $12,345.00.
True
The value returned by InputBox is a string
True
The line continuation character must be preceded with a space
True
When the Mask property of a masked text box is set to LL, at most two characters
(consisting of letters or spaces) can be entered into the masked text box
True
Named constants must have class-level scope
False
The value assigned to a class-level named constant can be changed in any procedure
False
The statement
Const TAX_RATE As Double
is not valid
True
The value of
DateDiff(DateInterval.Day, #1/1/2014#, #2/1/2014#)
is 31
True