Question
Jan Villaroel
Topic: Python Posted 9 months ago
A customer in a store is purchasing five items. Write a program that asks for the price of each item, then displays the subtotal

In Python:

A customer in a store is purchasing five items. Write a program that asks for the price of each item, then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 7 percent.


Answers
What are best answers and total votes?
No Votes
Vote
SignIn to Vote
Koala Tutor
Mar 5, 2024
Koala Ai Support

item_prices = []

for i in range(1, 6):
price = float(input("Enter the price of item {}: $".format(i)))
item_prices.append(price)

subtotal = sum(item_prices)
sales_tax = subtotal * 0.07
total = subtotal + sales_tax

print("\nSubtotal: ${:.2f}".format(subtotal))
print("Sales Tax: ${:.2f}".format(sales_tax))
print("Total: ${:.2f}".format(total))

Koala Tutor Got a question with my answer?
Message Me

Community
Completely FREE!
Powered by GPT-4
Marketplace
Get unlimited help from freelance Math experts.
Premium (Coming Soon)
GPT-4 + Premium Access