Multiple Choice
Suppose you would like your code to perform several tasks: Use a For…Next loop with an InputBox to prompt the user four times for the price of four different T-shirts, then display each shirt price with a 25% discount in the ListBox lstResult. Which of the following code segments correctly performs these tasks?
A) Dim intIndex As Integer
Dim sngPrice, sngDiscountPrice As Single
For intIndex = 1 To 4
SngPrice = CSng(InputBox("Enter price of shirt " & intIndex.ToString) )
SngDiscountPrice = sngPrice * 0.75
LstResult.Items.Add(sngDiscountPrice)
Next
B) Dim intIndex As Integer
Dim sngPrice, sngDiscountPrice As Single
For intIndex = 0 To 4
SngPrice = CSng(InputBox("Enter price of shirt " & intIndex.ToString) )
SngDiscountPrice = sngPrice - (.75 * sngPrice)
Next
LstResult.Items.Add(sngDiscountPrice)
C) Dim intIndex As Integer
Dim sngPrice, sngDiscountPrice As Single
For intIndex = 1 To 4
SngPrice = CSng(InputBox("Enter price of shirt " & intIndex.ToString) )
SngDiscountPrice = sngPrice * (.25 - sngPrice)
LstResult.Items.Add(sngDiscountPrice)
Next
D) Dim intIndex As Integer
Dim sngPrice, sngDiscountPrice As Single
For intIndex = 0 To 4
SngPrice = CSng(InputBox("Enter price of shirt " & intIndex.ToString) )
SngDiscountPrice = sngPrice * 0.25
LstResult.Items.Add(intIndex & " " & sngDiscountPrice)
Next
Correct Answer:

Verified
Correct Answer:
Verified
Q1: To get the number of items stored
Q3: Which of the following statements will assign
Q4: Which of the following statements correctly displays
Q5: Which statement is True in regard to
Q6: The entries in a ListBox are stored
Q7: Setting this property to True will put
Q8: Which type of loop uses a pretest
Q9: Which code example will calculate the number
Q10: This method erases all the items in
Q11: A _is a loop inside another loop.<br>A)