Deck 3: Variables, Input, and Output

Full screen (f)
exit full mode
Question
Which of the following is a valid name for a variable?

A) Two_One
B) 2One
C) Two One
D) Two.One
Use Space or
up arrow
down arrow
to flip the card.
Question
Which of the numbers below is equivalent to 0.000017489?

A) 1.7489E+05
B) 17489E+06
C) 1.7489E-06
D) 1.7489E-05
Question
What is the value of Int(8.9)?

A) 8
B) 8.9
C) 9
D) 1
Question
What is the correct statement when declaring and assigning the value of 100 to an Integer variable called numPeople?

A) Dim numPeople = 100
B) Dim numPeople = Int(100)
C) numPeople = 100
D) Dim numPeople As Integer = 100
Question
Which of the following statements removes all text from lstBox?

A) lstBox.Clear
B) lstBox.Items.Clear
C) lstBox.Text.Clear
D) lstBox.Items.Add("")
Question
What will be displayed when the following lines are executed? Dim xx As Double =3,y= 3 , y As Double =1= 1
Dim z As Double
z=x+(yx)x=yz=x+z\begin{array} { l } \mathrm { z } = \mathrm { x } + ( \mathrm { y } \star \mathrm { x } ) \\\mathrm { x } = \mathrm { y } \\\mathrm { z } = \mathrm { x } + \mathrm { z }\end{array}
lstBox. Items. Add (x+y+z)( x + y + z )

A) 4
B) 9
C) 10
D) None of the above
Question
Which of the following statements declare the variables a and b as type Integer?

A) a = 0: b = 0
B) Dim a, b
C) Dim a & b As Integer
D) Dim a, b As Integer
Question
The function Math.Int will always round mixed numbers down to the next lowest integer.
Question
The type of error that is normally spotted by the Code Editor is:

A) runtime
B) logic
C) syntax
D) user
Question
What value will be assigned to the numeric variable x when the following statement is executed? x = 2 + 3 * 4

A) 20
B) 14
C) 92
D) 234
Question
Which of the following arithmetic operations has the highest level of precedence?

A) +-
B) */
C) ^
D) ( )
Question
When declaring a variable that will refer to a submarine, a good name for the variable is sub.
Question
Given x = 3 and y = 1, what value will be assigned to the Double variable w when the following statement is executed?
w = (x + y) / (x - y)

A) 1
B) 2
C) 3
D) None of the above
Question
Keywords in Visual Basic are words that

A) should be used when naming variables.
B) are used to name controls, such as TextBox1, Command2, etc.
C) have special meaning and should not be used when naming variables.
D) are used as prefixes for control names (such as txt, btn, lbl, and lst).
Question
Assume that x, y, and temp are Integer variables. Which of the following lines of code swaps the values of x and y?

A) x = y
y = x
B) x = temp
x = y
y = temp
C) temp = x
x = y
y = temp
D) x = y temp = x y =
temp
Question
Suppose the Double variable num has the value 123.4567. What value will the following statement assign to num?
num = Math.Round(num, 2)

A) 123.4567
B) 123.457
C) 123.45
D) 123.46
Question
What will be the contents of the variable x after the following statement is executed? x = Math.Sqrt(((9 + 7) / (4 * 2)) + 2)

A) 1
B) 2
C) 3
D) 4
E) None of the above
Question
When using the equal sign to assign values, the variable on the left hand side of the equal sign will always receive the value.
Question
The variables firstName and firstNAME are identical.
Question
Which of the following is the same as 2 ^ 3?

A) 2 * 2 * 2
B) 2 * 3
C) 2 + 2 + 2
D) 3 * 3
Question
The value of (11 Mod 2) is 1.
Question
The following statement is valid.
y = y + 72
Question
Which of the following statements will NOT display the number 5 in the text box?

A) txtBox.Text = 5
B) txtBox.Text = "5"
C) txtBox.Text = CStr("5")
D) txtBox.Text = CStr(5)
Question
The following statement assigns 6 times the value of y to x.
x = 6y
Question
The exponential notation used in Visual Basic is exactly the same as standard mathematical notation.
Question
Which statement will display the words "Hello World" in a text box?

A) txtBox.Text = Hello & World
B) txtBox.Text = "Hello " & World
C) txtBox.Text = Hello & " World"
D) txtBox.Text = "Hello" & " World"
Question
The statement a + b = c assigns to c the sum of the values of a and b.
Question
You can use a variable name in almost any place you could use a literal value.
Question
An assignment statement is used to assign a value to a variable or property.
Question
The lstBox.Items.Clear statement is used to empty the contents of a list box.
Question
Numeric variables can be initialized to zero or any other number, but once they are initialized, they cannot be changed.
Question
Which of the following statements is a valid assignment statement?

A) txtBox = "Hello World"
B) "Hello World" = txtBox.Text
C) txtBox.Text = "Hello World"
D) Text.txtBox = "Hello World"
Question
The following two statements are equivalent, where numVar is a numeric variable.
numVar = numVar + 1
numVar += 1
Question
The value of (11 \ 2) is 1.
Question
Visual Basic always displays numbers in decimal format.
Question
What is the correct syntax for displaying the value of the String variable myString in a text box?

A) txtBox.Text = "myString"
B) txtBox.Text = myString
C) txtBox.Text.myString
D) txtBox.Text = Str(myString)
Question
Which of the following code statements generates an error?

A) txtFirst.Text = "Hello"
B) txtFirst.Text = Hello
C) txtFirst.Text = "My Text"
D) txtFirst.Text = Me.Text
Question
The following two statements are equivalent.
var1 = var2
var2 = var1
Question
A numeric variable that has not been assigned a value has the default value zero.
Question
The following statement is valid.
Dim x As Double = 3,542.36
Question
What is the value of ("12/15/09").Substring(3,2)?

A) /15
B) 15
C) /15/
D) 12/15/09
Question
The following statement contains what type of error?
txtAverage.Txt = CStr(CDbl(txtNum1.Text) + CDbl(txtNum2.Text) / 2)

A) a syntax error only
B) a logic error only
C) both a syntax error and a logic error
D) no errors
Question
The joining of two strings together to form a new string is called

A) concatenation.
B) addition.
C) compaction.
D) substrings.
Question
What will be the output of the following statement?
txtBox.Text = CStr(Math.Round(17 / 2))

A) 8
B) 9
C) 8.5
D) 17.00
Question
What will be displayed when the following lines are executed?
Dim x As Double = 2
'x = 3
txtBox.Text = CStr(x)

A) 3
B) 0
C) 2
D) None of the above
Question
Which of the following expressions will yield the string "John Doe", where name1 = "John Blake" and name2 = "Janet Doe"?

A) name1.Substring(0, 4) & name2.Substring(6, 8)
B) name1.Substring(0, 4) & name2.Substring(0, 3)
C) name1.Substring(0, 5) & name2.Substring(6, 3)
D) None of the above
Question
What character is used to signify the beginning of a comment statement?

A) asterisk
B) exclamation mark
C) apostrophe
D) backslash
Question
The symbol for the string concatenation operator is

A) @
B) &
C) %
D) #
Question
Which of the following expressions has as its value the value of strVar with its leading and trailing spaces removed?

A) strVar.Length
B) strVar.ToUpper
C) strVar.Ctrim
D) strVar.Trim
Question
What will be displayed when the following lines are executed?Dim a,ba , b , c As String
a = "THE WHOLE"
b=\mathbf { b } = "PART"
c=ac = a . Substring (CInt (Math.Sqrt (4)), b. Length)
txtBox. Text == cStr (c)( c )
(A) THE WHOLE PART
(B) 6
(C) E\mathrm { E } ?H (D) HE\mathrm { HE } W

A) THE WHOLE PART
B) 6
C) E WH
D) HE W
Question
What will be the value of numVar when the following code is executed? Dim strVar As String, numVar As Integer
strvar == "Now is the time for all good men"
numVar == strVar. Indexof ("the time for")

A) "Now is all good men"
B) "12"
C) 7
D) 8
Question
Which statement can be used to clear the contents of a text box?

A) txtBox.Empty = True
B) txtBox = ""
C) txtBox.Text = ""
D) txtBox.Wipe
Question
The following lines are valid.
Dim h As String = "Hello"
txtBox.Text = CStr(h.IndexOf("h"))
Question
All comment statements must be placed at the beginning of a program.
Question
Given the data assigned to the string variable str2 shown below, which of the following statements will assign the value ALL to the string variable str1?
str2 = "WHEN ALL ELSE FAILS, READ THE DIRECTIONS"

A) str1 = str2.Substring(5)
B) str1 = str2.Indestr1OfStr("ALL")
C) str1 = str2.Substring(6, 3)
D) str1 = str2.Substring(5, 3)
Question
The statement lstBox.Items.Add("") clears all the text from the list box.
Question
What will be the output of the following lines? Dim alphabet, soup As string
alphabet - "abcdefghijklmnopqrstuvwxyz"
soup = alphabet. ToUpper
txtBox.Text - alphabet.Substring (0,5)&( 0,5 ) \& soup. Sabstring (0,5)( 0,5 )

A) abcdeABCDE
B) ABCDEABCDE
C) eE
D) EE
Question
What will be the output of the following line?
txtBox.Text = "2" & 3

A) 23
B) 2 3
C) 5
D) Syntax error
Question
The value of strVar.Length is the number of characters in the value of strVar.
Question
If strVar.Length is 5, then the value of
strVar.Substring(4, 1)
is the last character of the
value of strVar.
Question
The statement txtBox = "Hello" is an example of a syntax error.
Question
A variable declared inside an event procedure cannot have the same name as a variable declared inside another procedure.
Question
A statement of the form dblVar = intVar is a narrowing assignment statement.
Question
With Option Strict On, a statement of the form intVar = dblVar is not valid.
Question
A variable declared inside an event procedure is said to have local scope.
Question
A string literal is a sequence of characters that is treated as a single entity.
Question
The following statements assign the lowercase letters to the string variable alphabet.
Dim alphabet As String
alphabet = abcdefghijklmnopqrstuvwxyz
Question
The Substring method is used to extract a portion of a string.
Question
What is the proper syntax when using a message dialog box?

A) MessageBox.Show("Hi there", "Hi")
B) MessageBox.Show(Hi there, Hi)
C) MessageBox.Show "Hi There", "Hi"
D) MessageBox.Show Hi There, Hi
Question
The following statement is valid where dog and cat are variables of the same type.
dog = cat
Question
Option Explicit requires you to declare every variable before its use.
Question
The Trim method is used to remove all blank space before and after a string.
Question
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.
Question
Typecasting is used to convert a value to a different data type.
Question
A variable declared outside of an event procedure is said to have class-level scope.
Question
When declaring a variable of type String, you must specify a length for the string.
Question
After the statement txtBox.Text = "" is executed, the text box will be clear and the cursor will appear inside the text box.
Question
An assignment statement of the form intVar = 8 / 4 is not valid.
Question
The empty string is the same as a string that contains one space.
Question
Which of the following is not used to assign a value to a variable?

A) InputBox statement
B) Dim statement
C) an assignment statement
D) MessageBox.Show statement
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/101
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: Variables, Input, and Output
1
Which of the following is a valid name for a variable?

A) Two_One
B) 2One
C) Two One
D) Two.One
A
2
Which of the numbers below is equivalent to 0.000017489?

A) 1.7489E+05
B) 17489E+06
C) 1.7489E-06
D) 1.7489E-05
D
3
What is the value of Int(8.9)?

A) 8
B) 8.9
C) 9
D) 1
A
4
What is the correct statement when declaring and assigning the value of 100 to an Integer variable called numPeople?

A) Dim numPeople = 100
B) Dim numPeople = Int(100)
C) numPeople = 100
D) Dim numPeople As Integer = 100
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
5
Which of the following statements removes all text from lstBox?

A) lstBox.Clear
B) lstBox.Items.Clear
C) lstBox.Text.Clear
D) lstBox.Items.Add("")
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
6
What will be displayed when the following lines are executed? Dim xx As Double =3,y= 3 , y As Double =1= 1
Dim z As Double
z=x+(yx)x=yz=x+z\begin{array} { l } \mathrm { z } = \mathrm { x } + ( \mathrm { y } \star \mathrm { x } ) \\\mathrm { x } = \mathrm { y } \\\mathrm { z } = \mathrm { x } + \mathrm { z }\end{array}
lstBox. Items. Add (x+y+z)( x + y + z )

A) 4
B) 9
C) 10
D) None of the above
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
7
Which of the following statements declare the variables a and b as type Integer?

A) a = 0: b = 0
B) Dim a, b
C) Dim a & b As Integer
D) Dim a, b As Integer
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
8
The function Math.Int will always round mixed numbers down to the next lowest integer.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
9
The type of error that is normally spotted by the Code Editor is:

A) runtime
B) logic
C) syntax
D) user
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
10
What value will be assigned to the numeric variable x when the following statement is executed? x = 2 + 3 * 4

A) 20
B) 14
C) 92
D) 234
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
11
Which of the following arithmetic operations has the highest level of precedence?

A) +-
B) */
C) ^
D) ( )
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
12
When declaring a variable that will refer to a submarine, a good name for the variable is sub.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
13
Given x = 3 and y = 1, what value will be assigned to the Double variable w when the following statement is executed?
w = (x + y) / (x - y)

A) 1
B) 2
C) 3
D) None of the above
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
14
Keywords in Visual Basic are words that

A) should be used when naming variables.
B) are used to name controls, such as TextBox1, Command2, etc.
C) have special meaning and should not be used when naming variables.
D) are used as prefixes for control names (such as txt, btn, lbl, and lst).
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
15
Assume that x, y, and temp are Integer variables. Which of the following lines of code swaps the values of x and y?

A) x = y
y = x
B) x = temp
x = y
y = temp
C) temp = x
x = y
y = temp
D) x = y temp = x y =
temp
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
16
Suppose the Double variable num has the value 123.4567. What value will the following statement assign to num?
num = Math.Round(num, 2)

A) 123.4567
B) 123.457
C) 123.45
D) 123.46
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
17
What will be the contents of the variable x after the following statement is executed? x = Math.Sqrt(((9 + 7) / (4 * 2)) + 2)

A) 1
B) 2
C) 3
D) 4
E) None of the above
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
18
When using the equal sign to assign values, the variable on the left hand side of the equal sign will always receive the value.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
19
The variables firstName and firstNAME are identical.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
20
Which of the following is the same as 2 ^ 3?

A) 2 * 2 * 2
B) 2 * 3
C) 2 + 2 + 2
D) 3 * 3
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
21
The value of (11 Mod 2) is 1.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
22
The following statement is valid.
y = y + 72
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the following statements will NOT display the number 5 in the text box?

A) txtBox.Text = 5
B) txtBox.Text = "5"
C) txtBox.Text = CStr("5")
D) txtBox.Text = CStr(5)
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
24
The following statement assigns 6 times the value of y to x.
x = 6y
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
25
The exponential notation used in Visual Basic is exactly the same as standard mathematical notation.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
26
Which statement will display the words "Hello World" in a text box?

A) txtBox.Text = Hello & World
B) txtBox.Text = "Hello " & World
C) txtBox.Text = Hello & " World"
D) txtBox.Text = "Hello" & " World"
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
27
The statement a + b = c assigns to c the sum of the values of a and b.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
28
You can use a variable name in almost any place you could use a literal value.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
29
An assignment statement is used to assign a value to a variable or property.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
30
The lstBox.Items.Clear statement is used to empty the contents of a list box.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
31
Numeric variables can be initialized to zero or any other number, but once they are initialized, they cannot be changed.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
32
Which of the following statements is a valid assignment statement?

A) txtBox = "Hello World"
B) "Hello World" = txtBox.Text
C) txtBox.Text = "Hello World"
D) Text.txtBox = "Hello World"
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
33
The following two statements are equivalent, where numVar is a numeric variable.
numVar = numVar + 1
numVar += 1
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
34
The value of (11 \ 2) is 1.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
35
Visual Basic always displays numbers in decimal format.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
36
What is the correct syntax for displaying the value of the String variable myString in a text box?

A) txtBox.Text = "myString"
B) txtBox.Text = myString
C) txtBox.Text.myString
D) txtBox.Text = Str(myString)
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following code statements generates an error?

A) txtFirst.Text = "Hello"
B) txtFirst.Text = Hello
C) txtFirst.Text = "My Text"
D) txtFirst.Text = Me.Text
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
38
The following two statements are equivalent.
var1 = var2
var2 = var1
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
39
A numeric variable that has not been assigned a value has the default value zero.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
40
The following statement is valid.
Dim x As Double = 3,542.36
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
41
What is the value of ("12/15/09").Substring(3,2)?

A) /15
B) 15
C) /15/
D) 12/15/09
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
42
The following statement contains what type of error?
txtAverage.Txt = CStr(CDbl(txtNum1.Text) + CDbl(txtNum2.Text) / 2)

A) a syntax error only
B) a logic error only
C) both a syntax error and a logic error
D) no errors
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
43
The joining of two strings together to form a new string is called

A) concatenation.
B) addition.
C) compaction.
D) substrings.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
44
What will be the output of the following statement?
txtBox.Text = CStr(Math.Round(17 / 2))

A) 8
B) 9
C) 8.5
D) 17.00
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
45
What will be displayed when the following lines are executed?
Dim x As Double = 2
'x = 3
txtBox.Text = CStr(x)

A) 3
B) 0
C) 2
D) None of the above
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
46
Which of the following expressions will yield the string "John Doe", where name1 = "John Blake" and name2 = "Janet Doe"?

A) name1.Substring(0, 4) & name2.Substring(6, 8)
B) name1.Substring(0, 4) & name2.Substring(0, 3)
C) name1.Substring(0, 5) & name2.Substring(6, 3)
D) None of the above
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
47
What character is used to signify the beginning of a comment statement?

A) asterisk
B) exclamation mark
C) apostrophe
D) backslash
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
48
The symbol for the string concatenation operator is

A) @
B) &
C) %
D) #
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
49
Which of the following expressions has as its value the value of strVar with its leading and trailing spaces removed?

A) strVar.Length
B) strVar.ToUpper
C) strVar.Ctrim
D) strVar.Trim
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
50
What will be displayed when the following lines are executed?Dim a,ba , b , c As String
a = "THE WHOLE"
b=\mathbf { b } = "PART"
c=ac = a . Substring (CInt (Math.Sqrt (4)), b. Length)
txtBox. Text == cStr (c)( c )
(A) THE WHOLE PART
(B) 6
(C) E\mathrm { E } ?H (D) HE\mathrm { HE } W

A) THE WHOLE PART
B) 6
C) E WH
D) HE W
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
51
What will be the value of numVar when the following code is executed? Dim strVar As String, numVar As Integer
strvar == "Now is the time for all good men"
numVar == strVar. Indexof ("the time for")

A) "Now is all good men"
B) "12"
C) 7
D) 8
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
52
Which statement can be used to clear the contents of a text box?

A) txtBox.Empty = True
B) txtBox = ""
C) txtBox.Text = ""
D) txtBox.Wipe
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
53
The following lines are valid.
Dim h As String = "Hello"
txtBox.Text = CStr(h.IndexOf("h"))
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
54
All comment statements must be placed at the beginning of a program.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
55
Given the data assigned to the string variable str2 shown below, which of the following statements will assign the value ALL to the string variable str1?
str2 = "WHEN ALL ELSE FAILS, READ THE DIRECTIONS"

A) str1 = str2.Substring(5)
B) str1 = str2.Indestr1OfStr("ALL")
C) str1 = str2.Substring(6, 3)
D) str1 = str2.Substring(5, 3)
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
56
The statement lstBox.Items.Add("") clears all the text from the list box.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
57
What will be the output of the following lines? Dim alphabet, soup As string
alphabet - "abcdefghijklmnopqrstuvwxyz"
soup = alphabet. ToUpper
txtBox.Text - alphabet.Substring (0,5)&( 0,5 ) \& soup. Sabstring (0,5)( 0,5 )

A) abcdeABCDE
B) ABCDEABCDE
C) eE
D) EE
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
58
What will be the output of the following line?
txtBox.Text = "2" & 3

A) 23
B) 2 3
C) 5
D) Syntax error
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
59
The value of strVar.Length is the number of characters in the value of strVar.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
60
If strVar.Length is 5, then the value of
strVar.Substring(4, 1)
is the last character of the
value of strVar.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
61
The statement txtBox = "Hello" is an example of a syntax error.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
62
A variable declared inside an event procedure cannot have the same name as a variable declared inside another procedure.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
63
A statement of the form dblVar = intVar is a narrowing assignment statement.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
64
With Option Strict On, a statement of the form intVar = dblVar is not valid.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
65
A variable declared inside an event procedure is said to have local scope.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
66
A string literal is a sequence of characters that is treated as a single entity.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
67
The following statements assign the lowercase letters to the string variable alphabet.
Dim alphabet As String
alphabet = abcdefghijklmnopqrstuvwxyz
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
68
The Substring method is used to extract a portion of a string.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
69
What is the proper syntax when using a message dialog box?

A) MessageBox.Show("Hi there", "Hi")
B) MessageBox.Show(Hi there, Hi)
C) MessageBox.Show "Hi There", "Hi"
D) MessageBox.Show Hi There, Hi
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
70
The following statement is valid where dog and cat are variables of the same type.
dog = cat
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
71
Option Explicit requires you to declare every variable before its use.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
72
The Trim method is used to remove all blank space before and after a string.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
73
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.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
74
Typecasting is used to convert a value to a different data type.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
75
A variable declared outside of an event procedure is said to have class-level scope.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
76
When declaring a variable of type String, you must specify a length for the string.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
77
After the statement txtBox.Text = "" is executed, the text box will be clear and the cursor will appear inside the text box.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
78
An assignment statement of the form intVar = 8 / 4 is not valid.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
79
The empty string is the same as a string that contains one space.
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
80
Which of the following is not used to assign a value to a variable?

A) InputBox statement
B) Dim statement
C) an assignment statement
D) MessageBox.Show statement
Unlock Deck
Unlock for access to all 101 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 101 flashcards in this deck.