Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please solve problem 3, problem1 and 2 already sloved. part1, part 2 with each code below thank you so much please just solve problem 3.
please solve problem 3, problem1 and 2 already sloved.
part1, part 2 with each code below
thank you so much
please just solve problem 3. 1 and 2 was already solved.
Problem 3 (Recording Sales) For this third part, you will be using files to record all sales that occur at Dino's shop. Again copy your solution from the previous part into a new file called a3q3.py. Do not overwrite your previous solution, as the TAs will want to see all of them Modify your code from the previous part so that once the customer has selected "No more doughnuts", the information for their order is added to a file called "sales.txt". The information you must record includes the customer's name and the number of each donut type. You are free to structure your file in any way you wish, but a suggested structure is given below (note: these are descriptions of what each line of the file would represent the actual values saved in the file should be the variable values from the program) Customer Name (purchase #1) # of Chocolate-dipped Maple Puff (purchase # 1) # of Strawberry Twizzler (purchase #1) # of Vanilla Chai Strudel (purchase #1) # of Honey-drizzled Lemon Dutchies (purchase #1) Customer Name (purchase #2) # of Chocolate-dipped Maple Puff (purchase #2) # of Strawberry Twizzler (purchase #2) # of Vanilla Chai Strudel (purchase #2) # of Honey-drizzled Lemon Dutchies (purchase #2) etc Add a final option to the donut selection menu that allows the user to select "Display sales statistics". When this option is selected, the program should read the sales.txt file and print out: the total number of sales that have been made, the total dollar amount of all purchases, the average dollar amount of all purchases, and the name of the customer with the largest single purchase. It may be easier to implement/test the sales statistics functionality in a separate program first and then copy the code into your final Dino's program Problem 1 (Taking Orders) Write a program called a3q1.py that creates a text-based purchasing system for Dino's International Doughnut ShoppeTM. For this first part, you'll build a menu system that allows customers to purchase quantities of a single type of doughnut. The program should start by asking the customer for their name. Next it should display a menu that asks the user to select one of the following 4 kinds of doughnuts 1. 2. 3. 4. Chocolate-dipped Maple Puff ($3.50 each) Strawberry Twizzler ($2.25 each) Vanilla Chai Strudel ($4.05 each) Honey-drizzled Lemon Dutchie ($1.99) The user should make their selection by entering the corresponding number. You can assume the user will enter an integer number, but must verify that it is a valid input (i.e., in the range 1-4). Once the customer has selected a variety, the program should ask how many of that variety the customer would like. Again, you can assume that a number is entered but must ensure it is a valid value (e.g., 0 or more). Following this, the program should provide the user with their receipt (report the type, quantity, and total cost of the user's order). Dino has made a special request that when telling the customer their order's cost that the program be personable and use the customer's name python code: L wq1 . . D/chg/python/a2a1.py (3.7.0b1)" Eile Edit Fgrmat Bun Optionsindow Help print ('Welcome to Dinol's International Doughnut Shoppe!) name-input ('Please enter your name to begin:) flag-i while (flag-1): pzint ( Please select a doughnut from the following menu: pzint ('1. Chocolate-dipped Maple Puff (3.5 each)) print (2. Strawberry Twizzler (2.25 each)) print ('3. Vni1la Chai Strudel (4.05 each) ') print (4. Honey-drizzled Lemon Dutchie (1.99) op=int ( input ( ' ) ) if (op>0 and op 0 and op " ) ) if (op>0 and op 4): flag-o if (op-l) count-int (input ('How many Chocolate-dipped Maple Puff wolud you like to purchase: print (name+' here is your receipt: print (' pzint (str (count) Chocolate-dipped Maple Puft' print ( " print ('Total cost: '+str (3.5 count)) elif (op-2): count-int (input('How many Strawberry Twizzler wolud you like to purchase:')) print (name+ here is your receipt:) print (' print (str (count)+Strawberry Twizzler') pzint ( print ('Total cost: +stz (2.25 count)) elif (op-3): count-int (input ('How many Vnilla Chai Strudel wolud you like to purchase:) print (name+here is your receipt:' print (' print (str (count)Vnilla Chai Strudel') pzint print ('Total cost: '+str (4.05 count)) else: count=int (input ('How many Honey-drizzled Lemon Dutchie wolud you like to purchase:")) print (name+' here is your receipt: print ( print (str (count)+ Honey-drizzled Lemon Dutchie pzint ( print ('Total cost: '+str (1.99 count)) print ('Thank you, have a noce day else: pzint ('I'm s0rry that\'s not a valid selection print"elcome to Dine's International Doughnut Shoppe!) name input( Please enter your name to begin:) flag = 1 doughnutsCount[0, 0, 0, 01 doughnuts Chocolate-dipped Maple Puff Strawberry Twizzler""Vanilla Chai Strue"Honey-drizzled Lemon Dutchie"] doughnutsPrices 3.5, 2.25, 4.05, 1.99] while (flag1)1 print("Please select a doughnut from the following menu:) print1. Chocolate-dipped Maple Puff (3.5 each)") print( 2. Strawberry Twizzler ($2.25 each)) print(3. Vanilla Chai Strudel ($4.05 each) print( 4. Honey-drizzled Lemon Dutchie (1.99)") print( 5. No more doughnuts op int(input'>)) if (op 0 and op code for problem 1 and 2 shows below:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started