Question: 14. The intNums array is declared as follows: Dim intNums() As Integer = {10, 5, 7, 2}. Which of the following blocks of code correctly

14. 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, intSub, and dblAvg variables contain 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock