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. Do While intSub < 4 intNums(intSub) = intTotal + intTotal intSub += 1 Loop dblAvg = intTotal / intSub b. Do While intSub < 4 intTotal += intNums(intSub) intSub = intSub + 1 Loop dblAvg = intTotal / intSub c. Do While intSub < 4 intTotal += intNums(intSub) intSub += 1 Loop dblAvg = intTotal / intSub – 1 d. Do While intSub < 4 intTotal = intTotal + intNums(intSub) intSub = intSub + 1 Loop dblAvg = intTotal / (intSub – 1)
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. Do While intSub < 4
intNums(intSub) = intTotal + intTotal
intSub += 1
Loop
dblAvg = intTotal / intSub
b. Do While intSub < 4
intTotal += intNums(intSub)
intSub = intSub + 1
Loop
dblAvg = intTotal / intSub
c. Do While intSub < 4
intTotal += intNums(intSub)
intSub += 1
Loop
dblAvg = intTotal / intSub – 1
d. Do While intSub < 4
intTotal = intTotal + intNums(intSub)
intSub = intSub + 1
Loop
dblAvg = intTotal / (intSub – 1)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps