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...
-
1. What facts would support Leonards primary argument as to why this commercial was a unilateral offer to contract? 2. If the languagein the catalog order form had allowed a consumer to write in the...
-
Diffusivity and Schmidt number for chlorine-air mixtures (a) Predict D AB for chlorine-air mixtures at 75F and 1atm. Treat air as a single substance with Lennard-Jones parameters as given in Appendix...
-
Two conspirators, Timothy Carpenter and Timothy Sanders, were charged with aiding and abetting a robbery affecting interstate commerce and the use or carriage of a firearm. At trial, the FBI...
-
On January 1, 2014, Valdez Company had Accounts Receivable $91,000 and Allowance for Doubtful Accounts $8,100. Valdez Company prepares financial statements annually. During the year, the following...
-
1. Create a database named "ALBUM" based on the following ERD. (Recall that this is ERD and you need to convert it to relational model and may need to normalize it before implementing in SQL). Make...
-
A URL is a type of _________. a. Web page b. URI c. Link d. Network
-
Required: Make the elimination entries to eliminate the intracompany lease. (dont do one big entry, separate them. Again, you are not doing a large, consolidated worksheet, just make the journal...
-
How does the real estate business of today like? And what challenges do owners of such business face? Why is it important to introduce and computerized system in the real estate industry or real...
-
1. (6%) The following pseudo-code is a solution to the infinite-buffer producer-consumer problem using semaphores discussed in class, where semaphore S is used to ensure mutual exclusion and the...
-
Identify the purposes of functional system modeling in digital engineering
-
Could someone explain how to respond to the questions below in an educated manner? Dr. C- I have discovered that that is what trainers may conduct and I agree that this may not work. You are right...
-
Let language L2 = {w|w contains neither 01 nor 10}. L2 is the complement of a simpler language. i. Write a description for L2 (using set notation, similar to L above). ii. Draw a DFA that recognizes...
-
A large utility company is considering two mutually exclusive methods for storing its coal combustion by products. One method is wet storage and the second method is dry storage. The company must...
-
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...
-
The following demonstration problem illustrates the use of the general journal, the four special journals introduced here, and the general ledger with two subsidiary ledgers. Sidney Carton began...
-
Tymonns Traders Ltd uses sales and purchases journals in its accounting system. The following transactions occurred during April 2019. Required (a) Complete the requirements below, assuming the...
-
On 30 June 2019 the following information appeared in the accounting records of Ndung and Mkoka. Balance of Accounts Receivable Control account, $3725 Total of schedule of accounts receivable,...
Study smarter with the SolutionInn App