What is the output of the following program when the button is clicked on?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim result As Double
Dim number(4) As Double
FillArray(number)
result = SumArray(number)
txtBox.Text = CStr(result)
End Sub
Sub FillArray(ByRef anyArray As Double)
Dim temp As String = IO.File.ReadAllLines("Data.txt")
For i As Integer = 0 To 4
anyArray(i) = CDbl(temp(i) )
Next
End Sub
Function SumArray(anyArray As Double) As Double
Dim total As Double
total = 0
For i As Integer = 0 To 4 Step 2
total += anyArray(i)
Next
Return total
End Function
Assume the five rows of the file Data.txt contain the following entries: 1, 3, 5, 7, 9
A) 0
B) 25
C) 15
D) None of the above
Correct Answer:
Verified
Q16: In the line of code
Dim scores
Q17: An array can contain both numeric and
Q18: What names are displayed in the list
Q19: Each individual variable in the list
student(0),
Q20: In the line of code
Dim scores
Q22: The following pair of statement is valid.
x
Q23: Given the Dim statement below, which set
Q24: What is the output of the following
Q25: If the following statement appears in a
Q26: What names are displayed in the list
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