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 = 0 To 4
SngPrice = CSngInputBox"Enter price of shirt " & intIndex.ToString) )
SngDiscountPrice = sngPrice * 0.75
LstResult.Items.AddsngDiscountPrice)
Next
B) Dim intIndex As Integer Dim sngPrice, sngDiscountPrice As Single
For intIndex = 0 To 4
SngPrice = CSngInputBox"Enter price of shirt " & intIndex.ToString) )
SngDiscountPrice = sngPrice - .25 * sngPrice)
Next
LstResult.Items.AddsngDiscountPrice)
C) Dim intIndex As Integer Dim sngPrice, sngDiscountPrice As Single
For intIndex = 1 To 4
SngPrice = CSngInputBox"Enter price of shirt " & intIndex.ToString) )
SngDiscountPrice = sngPrice * 0.75
LstResult.Items.AddsngDiscountPrice)
Next
D) Dim intIndex As Integer Dim sngPrice, sngDiscountPrice As Single
For intIndex = 1 To 4
SngPrice = CSngInputBox"Enter price of shirt " & intIndex.ToString) )
SngDiscountPrice = sngPrice * 0.25
LstResult.Items.AddintIndex & " " & sngDiscountPrice)
Next
Correct Answer:

Verified
Correct Answer:
Verified
Q1: To get the number of items stored
Q4: Which of the following statements correctly displays
Q5: Which statement is True in regard to
Q8: Which type of loop uses a pretest
Q10: This method erases all the items in
Q12: What is the difference in the execution
Q15: Which of the following sections of code
Q22: The first item in a ListBox has
Q23: A difference between a <b>ListBox</b> and a
Q33: A counter is a(n) _that can be