Solved

Which of the Following Code Fragments Calculates the Average of 5

Question 34

Multiple Choice

Which of the following code fragments calculates the average of 5 numbers input with an input box, and displays the result in lblResult?


A) intCount = 5
intSum = 0
Do While intCount = 5
IntSum = CInt(InputBox("enter a number") )
SngAvg = intSum / intCount
LblResult.Text = sngAvg.ToString()
Loop

B) intCount = 0
intSum = 0
Do While intCount < =5
IntValue = CInt(InputBox("enter a number") )
IntSum = intSum + intValue
Loop
SngAvg = intSum / intCount
LblResult.Text = sngAvg.ToString()

C) intCount = 0
intSum = 0
Do While intCount < = 5
IntValue = CInt(InputBox("enter a number") )
IntSum = intSum + intValue
IntCount += 1
Loop
SngAvg = intSum / intCount
LblResult.Text = sngAvg.ToString()

D) intCount = 0
intSum = 0
Do While intCount < 5
IntValue = CInt(InputBox("enter a number") )
IntSum = += intValue
IntCount += 1
Loop
SngAvg = intSum / intCount
LblResult.Text = sngAvg.ToString()

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents