Ask Question
2 June, 06:18

Total Purchase (SOWP Ch. 2 Problem 4) : 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.25%.

+1
Answers (1)
  1. 2 June, 06:38
    0
    Here is the python program:

    item_price1 = float (input ("Enter price of 1st item:"))

    item_price2 = float (input ("Enter price of 2nd item: "))

    item_price3 = float (input ("Enter price of 3rd item: "))

    item_price4 = float (input ("Enter price of 4th item: "))

    item_price5 = float (input ("Enter price of 5th item: "))

    sub_total_of_sale = (item_price1 + item_price2 + item_price3 + item_price4 + item_price5)

    amount_of_sales_tax = sub_total_of_sale * 0.0725

    total = sub_total_of_sale + amount_of_sales_tax

    print ("Sub Total of the Sale is: ", sub_total_of_sale)

    print ("The amount of sales tax is: ", amount_of_sales_tax)

    print ("Total is: ", total)

    Explanation:

    This program first prompts the user to enter price of 5 items and input () function is used here to let the user enter the price.

    Next the sub_total_of_sale variable stores the sum of all these 5 items

    amount_of_sales_tax stores the sum of sale tax which is 7.25% and sub total of 5 items. here 0.0725 means 7.25/100

    total holds the sum of sub total of price of 5 items and sales tax.

    Lastly it displays sub total of sale, amount of sales tax and total using print statement.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Total Purchase (SOWP Ch. 2 Problem 4) : A customer in a store is purchasing five items. Write a program that asks for the price of each ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers