The intNums array is declared as follows: Dim intNums() As Integer = {10, 5, 7, 2}. Which
Question:
The intNums array is declared as follows: Dim intNums() As Integer = {10, 5, 7, 2}. Which of the following blocks of code correctly calculates the average value stored in the array? The intTotal variable contains the number 0 before the loop is processed.
a. For Each intX As Integer In intNums
intTotal += intX
Next intX
dblAvg = intTotal / intNums.Length
b. For Each intX As Integer In intNums
intTotal += intNums(intX)
Next intX
dblAvg = intTotal / intX
c. For Each intX As Integer In intNums
intTotal += intNums(intX)
intX += 1
Next intX
dblAvg = intTotal / intX
d. None of the above.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: