Question: Hi, I need help for my Visual Basic class. 1) True or False: : The most common selection statement is the If-Then-Else. 2) What appears
Hi, I need help for my Visual Basic class.
1) True or False: : The most common selection statement is the If-Then-Else.
2) What appears in the Msgbox when this is run: If 1=2 Then If 2=3 Then Msgbox("Ok") Else Msgbox("Not Ok") End If Else If 2=2 Then Msgbox("Ok") Else MsgBox("Not Ok") End If End If
3)
What is in sString at the end of this code:
Dim sString as String Dim iIndex as Integer = 10
sString ="Unknown" Select Case iIndex Case Is < 4 sString = "Small" Case Is < 1 sString = "Large" Case Else sString = "Huge" End Select
4) True or False: The conditional in the IF statement is evaluated to be either True or False
5) What is in sString at the end of this code: Dim sString as String Dim iIndex as Integer = 5 sString = "Unknown" Select Case iIndex Case Is <= 4 sString = "Small" Case Is >= 6 sString = "Large" End Select
6) What appears in the Messagebox when this is run: If 5 > 4 And 4 > 5 Then Msgbox("Ok") Else Msgbox("Not Ok") End If
7)
Which of the following is not legal syntax for an IF statement (Note Answer with letter A,B,C,or D only):
A) If a > b Then .intX = 100
B) If a > b Then intX = 200 End If
C) If a > b Then intX = 100 Else .intX = 200 End If
D) If a > b .intX = 100 End If
8) True or False: Select Case construct is used for iteration in a loop
9) True or False Another form of the IF statement is to use ElseIf in place of Else
10) True or False: The Select Case statement is preferred to using a series nested ElseIf
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
