Hi, I need help with my Visual Basic class. 7) Which of the following is not leg
ID: 3805307 • Letter: H
Question
Hi, I need help with my Visual Basic class.
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
Explanation / Answer
Question Number 7 : -
A) In this Option variable name is start with '.' This is not legal for variable Name. other wise Option A is work fine.
B) For single line If statement End If is not required. other wise if this statement like this
If a>b Then
intx = 100
End If
then this syntax is correct.
3) For single line statements End If is not required and also here variable name start with '.' these two things are not correct in this statement.
4) Here also same reason as 3
Question Number 8 :-
False
Beacause Seclect case construct is not used for iteration in a loop.
Select case construct is used for like if conditional statement only
and this used like "statement allows a variable to be tested for equality against a list of values"
it is easily user readable format.
9) False
In control statements ElseIf and Else are optional statements. It is not Another form of the IF statement.
10) True
Because "select statement as part of the statement sequence of an outer select statement. Even if the case constants of the inner and outer select contain common values, no conflicts will arise."
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.