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 for Product ID to end each sale After each sale your
program must ask if you want to do another sale ycontinuen end program
At the beginning of the day, the cash drawer has $ 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
productID
quantity
price
subtotal
salesTax
totalSale
taxRate
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 inputEnter the first Product ID to end:
productID intproductID
# 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 inputWould you like another sale y or n
# Print out cash drawer
print
printfTotal in cash drawer: $cashDrawer: f
Is there a way to enter as the product ID to end the loop without using break?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
