Project 1: The Corner Store You have been asked to write a program to calculate sales...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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}") 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}")
Expert Answer:
Related Book For
Foundations of Finance The Logic and Practice of Financial Management
ISBN: 978-0132994873
8th edition
Authors: Arthur J. Keown, John D. Martin, J. William Petty
Posted Date:
Students also viewed these algorithms questions
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
At Blossom Company, events and transactions during 2020 included the following. The tax rate for all items is 20%. (1) Depreciation for 2018 was found to be understated by $148000. (2) A strike by...
-
The precise volume of water in a beaker depends on the temperature of the water. Rank from greatest to least the volumes of water at these temperatures: a. 0C b. 4C c. 10C
-
Chemical Processors manufacture Wonderchem using two processes, mixing and distillation. The following details relate to the distillation process for a period:No opening work in progress (WIP)...
-
An object of characteristic length \(L=0.5 \mathrm{~m}\) is \(10^{\circ} \mathrm{C}\) warmer than the surrounding fluid, which is flowing at a velocity of \(0.5 \mathrm{~m} / \mathrm{s}\). Graph the...
-
Sawyer Pharmaceuticals manufactures an over-the-counter allergy medication. The company sells both large commercial containers of 1,000 capsules to health-care facilities and travel packs of 20...
-
A parallel-plate capacitor is to be constructed by using, as a dielectric, rubber with a dielectric constant of 3.20 and a dielectric strength of 15.0 MV/m. The capacitor is to have a capacitance of...
-
Lee, Danny and Sue were childhood friends. They loved horses and dreamed of one day owning a horse who won the huge prize money in the famous annual Melbourne Cup horse race. To fulfill this dream,...
-
Suppose that a discrete-time system is described by the input-output relation y[n] = (x[n]) (a) Determine the output when the input is the complex exponential signal (b) Is the output of the form...
-
(6) 2.1. Define planning and discuss why planning in any farm business is essential. 2.2. Demonstrate your understanding of risks and uncertainties in farming and describe any three methods you can...
-
A researcher estimated a model for the daily percentage returns (rt) on the Australian stock market index over the last 100 days of trading. The results for this model (Model 1) were: rt = 0.25...
-
The management of Sonate Company, a wholesale distributor of fashion products, is considering the purchase of a $72,000 machine that would reduce operating costs in its warehouse by $16,000 per year....
-
A scuba diver and her gear displace a volume of 62.0 L and have a total mass of 65.8 kg. Part A What is the buoyant force on the diver in sea water? FB = Submit Request Answer Part B Will the diver...
-
Demand is strong and Nick Seamon can sell more sandwiches. In the short-run, how can his daily deli handle more volume? What will happen to the marginal product of labor at higher production? Why?...
-
A small package is released from rest at A and moves along the skate wheel conveyor ABCD. The package has a uniform acceleration of 4.8 m/s 2 as it moves down sections AB and CD , and its velocity is...
-
Below is a sample of the data in the file NFLAttendance which contains the 32 teams in the National Football League, their conference affiliation, their division, and their average home attendance....
-
FarmCo, Inc. follows a policy of paying out cash dividends equal to the residual amount that remains after funding 60 percent of its planned capital expenditures. The firm tries to maintain a 40...
-
Made- It common stock currently sells for $ 22.50 per share. The companys executives anticipate a constant growth rate of 10 percent and an end- of- year dividend of $ 2. a. What is your expected...
-
You have come up with a great idea for a Tex- Mex- Thai fusion restaurant. After doing a financial analysis of this venture, you estimate that the initial outlay will be $ 6 million. You also...
-
What is the impact of the Internet on international business? Which companies and which countries will gain as Internet usage increases throughout the world? Which will lose?
-
How do merchandise exports and imports differ from service exports and imports?
-
What is portfolio investment?
Study smarter with the SolutionInn App