Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 1: The Corner Store You have been asked to write a program to calculate sales totals for a corner store. Your program will

imageimageimage

Project 1: The Corner Store 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 ('y' -continue, '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. Input Your program must take the following input: Product ID Number (int) Quantity for each item purchased (int) Use the following dataset to determine the price and taxability for each item. First Sale: Second Sale: Third Sale: Product ID 101 102 103 104 105 Product ID 102 103 105 Product ID 101 103 104 Price $3.95 $1.85 $2.49 $5.19 $4.99 Price $1.85 $2.49 $4.99 Price $3.95 $2.49 $5.19 Quantity 1 2 1 4 5 Quantity 1 3 2 1 Taxable No Yes Yes Yes No Quantity Taxable No Yes Yes 2 2 Taxable Yes Yes No Calculating Tax For those items that are taxable, assume a 7.5% sales tax. Be sure to keep a running total of tax for the each sale. Getting Started You must use the starter file provided with this assignment. What to turn in: A copy of your source code A printout of your program's output # 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(" print () [ Corner stor e ]----") #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 productID != -1: #Enter the quantity quantity = input ("Enter the quantity: ") quantity int (quantity) # Look up price and whether it is taxable if productID == 101: price = 3.95 taxRate = 0.0 productID == 105: price = 4.99 taxRate = 0.0 elif productID == 102: price = 1.85 taxRate = 0.075 productID == 103: price = 2.49 taxRate = 0.075 productID == 104: price = 5.19 taxRate = 0.075 else: print("ERROR: Product ID not found!") # Add to subtotal and sales Tax subtotal + price* quantity salesTax + price* quantity* taxRate # Get next productID productID = input('Enter the next Product ID (-1 to end) : ) productID = int (productID) # End of while loop # Add subtotal and salesTax to totalSale totalSale = subtotal + salesTax #Print out receipt print () print (f"Subtotal: ${subtotal: 7.2f}") print (f"Sales Tax: ${salesTax: 7.2f}") print () # Add Total Sale to Cash Drawer cashDrawer + totalSale #Zero out subtotal and salesTax subtotal = 0.0 salesTax = 0.0 #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}")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Foundations of Finance The Logic and Practice of Financial Management

Authors: Arthur J. Keown, John D. Martin, J. William Petty

8th edition

132994879, 978-0132994873

Students also viewed these Algorithms questions

Question

What is the purpose of the journal wizard?

Answered: 1 week ago