Python Greg's Grocery Store Time required: 30 minutes Greg's Grocery store would like a program to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Python Greg's Grocery Store Time required: 30 minutes Greg's Grocery store would like a program to calculate the total sales for the week. Name: total sales.py Author: Created: Purpose: Total weekly sales 9 def main (): #Initialize variable total sales - 0.0 # Initialize parallel lists daily sales = [] days_of_week = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ] # Append 7 items to the list, 0-7 index for i in range (7): sales float (input (f'Enter the sales for (days_of_week[i]): ')) daily_sales.append(sales) # Iterate through list one item at a time # accumulate total for number in daily_sales: total sales += number # Display total sales print (f'Total sales for the week: $(total_sales:, .2f}') 35 # Call the main function 36 if _main__': name main () Add the following features to the program: Use parallel lists to print out the day and sales for Monday through Friday only. Calculate and display the average daily sales for the week. (Calculate the average manually, don't use math functions.) Example run: Greg's Grocery Store Weekly Sales Enter the sales for Sunday: 100 Enter the sales for Monday: 150 Enter the sales for Tuesday: 200 Enter the sales for Wednesday: 175 Enter the sales for Thursday: 250 Enter the sales for Friday: 50 Enter the sales for Saturday: 100 Sales during the week days Monday: $150.00 Tuesday: $200.00 Wednesday: $175.00 Thursday: $250.00 Friday: $50.00 Total sales for the week: $1,025.00 Average sales per day: $146.43 Assignment Submission 1. Attach all Python program files to the assignment. Python Greg's Grocery Store Time required: 30 minutes Greg's Grocery store would like a program to calculate the total sales for the week. Name: total sales.py Author: Created: Purpose: Total weekly sales 9 def main (): #Initialize variable total sales - 0.0 # Initialize parallel lists daily sales = [] days_of_week = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ] # Append 7 items to the list, 0-7 index for i in range (7): sales float (input (f'Enter the sales for (days_of_week[i]): ')) daily_sales.append(sales) # Iterate through list one item at a time # accumulate total for number in daily_sales: total sales += number # Display total sales print (f'Total sales for the week: $(total_sales:, .2f}') 35 # Call the main function 36 if _main__': name main () Add the following features to the program: Use parallel lists to print out the day and sales for Monday through Friday only. Calculate and display the average daily sales for the week. (Calculate the average manually, don't use math functions.) Example run: Greg's Grocery Store Weekly Sales Enter the sales for Sunday: 100 Enter the sales for Monday: 150 Enter the sales for Tuesday: 200 Enter the sales for Wednesday: 175 Enter the sales for Thursday: 250 Enter the sales for Friday: 50 Enter the sales for Saturday: 100 Sales during the week days Monday: $150.00 Tuesday: $200.00 Wednesday: $175.00 Thursday: $250.00 Friday: $50.00 Total sales for the week: $1,025.00 Average sales per day: $146.43 Assignment Submission 1. Attach all Python program files to the assignment.
Expert Answer:
Answer rating: 100% (QA)
Python code definition of the main method def main initialize the totalsales to 0 totalsales 00 decl... View the full answer
Related Book For
Mathematical Applications for the Management Life and Social Sciences
ISBN: 978-1305108042
11th edition
Authors: Ronald J. Harshbarger, James J. Reynolds
Posted Date:
Students also viewed these electrical engineering questions
-
I want to write a java program to calculate the letter grades of each student in the class based on the scale shown on the course overview and the syllabus. Which type of decision structure would be...
-
The following table shows the total sales for 10 high-end supermarket stores. These are the same stores that you examined in Exercises 35 and 36. In addition to the population of the towns in which...
-
The total sales for April were $265,000, of which 60% was on credit. One percent of the total sales was defective and returned. Two percent of the net credit sales were sales discounts. What are the...
-
Which sentence below most strongly emphasizes the importance of the decision? (5 points) Over the next year, the direction of the company depends on the quick decision we must make. The direction of...
-
Sleek Sneakers Co. is one of many firms in the market for shoes. a. Assume that Sleek is currently earning short run economic profits. On a correctly labeled diagram, show Sleeks profit-maximizing...
-
Select one of the books in the REORDERINFO view and try to change its ISBN. Was an error message displayed when performing this step? If so, what was the cause of the error message?
-
How to draft a pretrial memorandum?
-
A six-column table for JJW Company follows. The first two columns contain the unadjusted trial balance for the company as of July 31, 2011. The last two columns contain the adjusted trial balance as...
-
Initial Leila, Dante, and Alan have a total of $111 in their wallets. Alan has 4 times what Leila has. Dante has $9 less than Leila. How much does each have? Amount in Leila's wallet: $0 Amount in...
-
As the volunteer business manager for the New City Band (City Band), you are responsible for preparing the operating budget for the organizations upcoming summer concert season. Each year, City Band...
-
A Monica who is aged 54, is employed as a Senior Manager with Abacus, a large accounting firm based in Sydney. During the 2020 tax year Abacus contributed $20,000 into QRest Super, which Monica...
-
Q1 (a) (b) Use Hooke's law to derive an expression for the shear modulus G in terms of Young's modulus E and the Poisson's ratio v. This relationship sets a limit for admissible values of Poisson's...
-
Stone Shoe Company adopted dollar-value LIFO on January 1, 2019. The company produces four products and uses a single inventory pool. The company's beginning inventory consists of the following: Type...
-
The first ever x-ray of the human body was that of the hand of Wilhelm Roentgen's wife. Roentgen had accidentally discovered X-rays the week before, on November 8, 1895, and chose his wife's hand to...
-
Each branch in the tree spans 3 months (5t = 0.25) 60 Node Time: 0.0000 77.04 46.73 0.2500 98.92 60 36.39 0.5000 127.02 77.04 46.73 28.34 163.10 0.7500 98.92 60 36.39 22.07 1.0000
-
Molin Corporation is a manufacturer that uses job-order costing. The company closes out any overapplied or underapplied overhead to Cost of Goods Sold at the end of the year. The company has supplied...
-
SET-K: Last Name: F18: ECON 205 Instructions/Suggestions 1. Please note the SET on Question paper and write this SET on Scantron Form No. 882-ES 2. Write your LAST and FIRST NAME (UPPER CASE please)...
-
How does Kant answer Humes bundle theory of self? Do you think he is successful?
-
A used piece of rental equipment has 212 years of useful life remaining. When rented, the equipment brings in $800 per month (paid at the beginning of the month). If the equipment is sold now and...
-
Use properties of limits and algebraic methods to find the limits, if they exist. 1. limx-35 (34 + x) 2. limx80 (82 - x) 3. limx-1 (4x3 - 2x2 + 2) 4. limx3 (2x3 - 12x2 + 5x + 3)
-
As the following table shows, projections indicate that the percent of U.S. adults with diabetes could dramatically increase. (a) Find a linear model that fits the data in the table, with x = 0 in...
-
a. Who may bring suit under the 1934 Securities Exchange Act? b. Is the basis for action the same as in a 1933 Act suit? Explain.
-
What are the responsibilities of the plaintiff and the defendant in a 1933 Act suit?
-
Under what circumstances will a statement be presumed to be misleading?
Study smarter with the SolutionInn App