What states are displayed in the list box by the following program segment?
Dim states As String = {"Colorado", "New Mexico", "Arizona", "Utah"}
Dim query = From state in states
Where ContainsE(state)
Select state
For Each state in query
lstBox.Items.Add(state)
Next
Function ContainsE(word As String) As Boolean
If word.IndexOf("E") <> -1 Or word.IndexOf("e") <> -1 Then
Return True
Else
Return False
End If
End Function
A) Colorado
B) New Mexico
C) Colorado, New Mexico, Arizona, Utah
D) No states
Correct Answer:
Verified
Q27: What numbers are displayed in the list
Q28: Consider the following Dim and assignment statements
Q29: What numbers are displayed in the list
Q30: Unless otherwise specified, Visual Basic assigns the
Q31: What is the output of the following
Q33: What names are displayed in the list
Q34: A fractional number such as 4.6 is
Q35: What numbers are displayed in the list
Q36: What is displayed in the message box
Q37: What is the output of the following
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents