What years are displayed in the list box by the following program segment?
Dim years As Integer = {1492, 1776, 1840, 1929, 1945, 2005}
Dim query = From year in years
Where Is20thCentury(year)
Select year
For Each year in query
lstBox.Items.Add(year)
Next
Function Is20thCentury(num As Integer) As Boolean
If (num >= 1900) and (num < 2000) Then
Return True
Else
Return False
End IF
End Function
A) 1929 and 1945
B) 1929
C) 1492, 1776, 1840, 1929, 1945, 2005
D) No years
Correct Answer:
Verified
Q46: What colleges are displayed in the list
Q47: What words are displayed in the list
Q48: What numbers are displayed in the list
Q49: What words are displayed in the list
Q50: Arrays are said to be ordered only
Q52: Consider the following structure definition. Which Dim
Q53: Suppose a structure is created with the
Q54: What numbers are displayed in the list
Q55: What names are displayed in the list
Q56: In an ascending ordered array, the value
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