You have been asked to develop an algorithm to calculate the total cost of a purchase order that contains several T-shirts. The cost of each T-shirt and the tax rate is known. The standard shipping charge for the entire order is $5.75, and the special delivery charge is $23.65. In addition, there is no tax on the shipping cost. Which of the following is the correct pseudocode for the required algorithm?
a) For each T-shirt on the purchase order:
Order cost = order cost + T-shirt cost
Total purchase order cost = order cost + tax rate + 5.75
b) For each T-shirt on the purchase order:
Order cost = order cost + T-shirt cost
If standard shipping
Shipping cost = 5.75
Else
Shipping cost = 23.65
Total purchase order cost = order cost * tax rate + shipping cost
c) If standard shipping
Shipping cost = 5.75
Else
Shipping cost = 23.65
For each T-shirt on the purchase order:
Order cost = order cost + T-shirt cost + shipping cost
Total purchase order cost = order cost * tax rate
d) If special delivery
Shipping cost = 5.75
Else
Shipping cost = 23.65
For each T-shirt on the purchase order:
Order cost = order cost + T-shirt cost
Total purchase order cost = order cost * tax rate + shipping cost

Respuesta :

Answer:

b

Explanation:

1) order cost needs to be calculated by adding T-shirt cost for each T-shirt.

2) shipping type should be decided using if else. Shipping cost must be 5.75 when standard shipping is chosen. Otherwise the shipping cost must be 23.65.

3) Total purchase order cost needs to be calculated by adding the shipping cost to the order cost (Remember to consider the tax rate here).

ACCESS MORE