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
```
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
```
You might also like to view...
Consider an implementation of a linked list sorted in an ascending manner. What is the complexity of retrieving the median value from the list?
a. O(n) b. O(1) c. O(log n) d. It can't be determined
The Windows kernel includes what two main components?
A. Background services B. executive services C. HAL D. shell
?You work for a company that is growing. Originally, all the users in all departments had access to all the data in the database. It is considered a security risk. What is an appropriate action to reduce the risk?
A. ?Install a two-step login procedure, where the user has to key in additional information for logging in B. Install and provide stronger anti-virus software on the users' computers C. Tweak the firewall parameters so that outgoing traffic can be better controlled D. Assign roles and privileges to users so that only job-relevant data is accessible to the user.
Coding is only one of the six steps of programming.
Answer the following statement true (T) or false (F)