subject

Create a program that: Creates a sales receipt, displays the receipt entries and totals, and saves the receipt entries to a file Prompt the user to enter the Item Name Item Quantity Item Price Display the item name, the quantity, and item price, and the extended price (Item Quantity multiplied by Item Price) after the entry is made Save the item name, quantity, item price, and extended price to a file When you create the file, prompt the user for the name they want to give the file Separate the items saved with commas Each entry should be on a separate line in the text file Ask the user if they have more items to enter Once the user has finished entering items Close the file with the items entered Display the sales total If the sales total is more than $100 Calculate and display a 10% discount Calculate and display the sales tax using 8% as the sales tax rate The sales tax should be calculated on the sales total after the discount Display the total for the sales receipt, I thought this would work (see below) but I keep getting errors:sales_total=0 Item_name=input("Enter the item name: ") Item_quantity=int(input("Enter the item quantity: ")) Item_price=int(input("Enter the item price $: ")) Extender_price=Item_price*Item_quan tity sales_total=sales_total+Extender_pr ice print("\nItem name:{}".format(Item_name)) print("Item quantity:{}".format(Item_quantity)) print("Item price:${}".format(Item_price)) print("Extended price:${}".format(Extender_price)) filename=input("Enter the filename:") f=open(filename+".txt","a+") #writing the values to file f. write((Item_name)+","+str(Item_quan tity)+","+str(Item_price)+","+str(E xtender_price)+"\n") while(True): option=input("Do you want to enter more items(Yes/No)?") if option. lower()=="yes": Item_name=input("Enter the item name: ") Item_quantity=int(input("Enter the item quantity: ")) Item_price=int(input("Enter the item price: ")) Extender_price=Item_price*Item_quan tity sales_total=sales_total+Extender_pr ice print("\nItem name:{}".format(Item_name)) print("Item quantity:{}".format(Item_quantity)) print("Item price:${}".format(Item_price)) print("Extended price:${}".format(Extender_price)) f. write((Item_name)+","+str(Item_quan tity)+","+str(Item_price)+","+str(E xtender_price)+"\n")#writing them to the file f. close() #closing the file else: break sales_tax=8 if sales_total>100: discount_value=sales_total*(10/100) sales_total=sales_total-discount_va lue tax=sales_total*(sales_tax/100) total=sales_total-tax print("Discount:\t-",discount_value ) print("Sales tax:\t+",tax) print("After sales tax applied:",total) else: sales_total=sales_total-discount_va lue tax=sales_total*(sales_tax/100) total=sales_total-tax print("Discount:\t-",discount_value ) print("Sales tax:\t+",tax) print("After sales tax applied:",total)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:40
What are the three parts to physical security standards for various types of army equipment and the risk level
Answers: 2
question
Computers and Technology, 22.06.2019 15:50
The file sales data.xlsx contains monthly sales amounts for 40 sales regions. write a sub that uses a for loop to color the interior of every other row (rows 3, 5, etc.) gray. color only the data area, columns a to m. (check the file colors in excel.xlsm to find a nice color of gray.)
Answers: 2
question
Computers and Technology, 24.06.2019 03:00
Will do anything for brainlest so can you guys me out i will try my best to you out
Answers: 1
question
Computers and Technology, 24.06.2019 10:40
Joe needs to see the slide transitions and animations he has applied to his slides in a large view. which presentation view should he use? in which tab would joe find the animations option to make further changes, if any?
Answers: 1
You know the right answer?
Create a program that: Creates a sales receipt, displays the receipt entries and totals, and saves t...
Questions
question
Mathematics, 22.02.2021 22:10
question
English, 22.02.2021 22:10
question
Biology, 22.02.2021 22:10
question
Spanish, 22.02.2021 22:10
question
Spanish, 22.02.2021 22:10
question
Mathematics, 22.02.2021 22:10
Questions on the website: 13722362