Question: Python: You have been asked to write a program to calculate sales totals for a corner store. Your program will not know how many products

Python: You have been asked to write a program to calculate sales totals for a corner store. Your program will
not know how many products each customer will buy, so your program will have to repeat the process
until the last product has been entered (use -1 for Product ID to end each sale). After each sale your
program must ask if you want to do another sale (ycontinue,n end program).
At the beginning of the day, the cash drawer has $100 in it. At the end of the program you must display
how much money is in the drawer after handling all your sales transactions use the code below. # Corner Store Program
# Purpose: Keep track of daily sales
cashDrawer =100.00
productID =0
quantity =0
price =0.0
subtotal =0.0
salesTax =0.0
totalSale =0.0
taxRate =0.0
anotherSale ='y'
print()
print("----------[ C o r n e r S t o r e ]----------")
print()
# Loop for each sale
while :
# Enter the first productID
print()
productID = input('Enter the first Product ID (-1 to end): ')
productID = int(productID)
# Loop for each product
while :
# Enter the quantity
# Look up price and whether it is taxable
# Add to subtotal and salesTax
# Get next productID
# End of while loop
# Add subtotal and salesTax to totalSale
# Print out receipt
print()
print()
# Add Total Sale to Cash Drawer
cashDrawer += totalSale
# Zero out subtotal and salesTax
# Ask for another sale
anotherSale = input("Would you like another sale ('y' or 'n')?")
# Print out cash drawer
print()
print(f"Total in cash drawer: ${cashDrawer: 7.2f}")
Is there a way to enter -1 as the product ID to end the loop without using break?
Python: You have been asked to write a program to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!