Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can somebody help me with Pythone code, please? 1. Dessert Shop Part 5: Overriding Methods Problem In this part of the project, you will override

Can somebody help me with Pythone code, please?
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1. Dessert Shop Part 5: Overriding Methods Problem In this part of the project, you will override the detault magic method in ail classes to enable printing a receiot using the bultin print function. You have implemented method in a previous project, but now we present it in the context of overriding the defaut inplementation. You may ask why we might implement mehods specilically when our order output is going to a PCF? Good quection! There are a few main answers: 1. "Siringitying" an object is helptu for debuggng even it its not usec in the actual appication, in this case, it could be useful when cobugging Order code. 2. Another idea is to design obects to taka advantage of feacurespumbing in a languago when a is conveniert in tis cale. rrite 0 wit cal Aitr under the hood to pint any object We raplace the detault something more meaninglul. Changes to dessertshop module - Conment out al the ines that prit incidual fooris to fin corsoie, f you have any. Delete them when you do not ined per aryminione. oxample Your code must stil produce a conect inciet, pat piona in prevous parts. Changes to the Concrete Subclasses of Dessertltem - add method to Caridy, Coove, jceCrearn Sundae classes. Do not print in this method. Per the Pyncon docs, this method roturns a string to the calier. Uieing candy oorn as an exirgit, formatted liem ourput would jook like this: The ine gives atem name, ouatity price per int, coot and tax ice Croam Sundaes are ditterent in that itey have ancetw ire of comma separated values. As aways, 1 suggest using thatinge to buld stings be fis one. We format the hem strings this way cecause e thwe ithe ating form easier to procest programmatically, while sul beng fumantenadablof Changes to Order Class - add meniod to Order clish. The ocder should look like the ouputisen tha examcie run below, n nice long to print on one ine. Test Cases cases to make sure they sill pass then venty by mancual inspectico that that mew version with evertidden string methods is cusect. Example Scenario 1i: Gandy 2. Cookie 3. ice Cream 4: Sunday What would you like to add to the crster? (1-4, Enter for done) 2 Enser the type of cooke: Chocolate Orip Macadimia Ener the quantiy purchased: 5 Enter the price per daren, 499 1: Candy 2. Cootie 3. lce Croam 4. Sundar What would you the ta agd so the orden {1+ i. Enter for done? 3 1. Dessert Shop Part 5; Overriding Methods Enter the :ype of ice cream: Mint Chocolate Chip Enter the number of scoops: 4 Enter the price per scoop: 89 1: Candy 2. Cookie 3: Ice Cream 4) Sunday What would you lke to add to the ordar (1)-4. Erreer for donpe)/4 Enter the type of ice cream Vanila Enter the mumber of scoops: 3 Enter the price per scoop: 89 Enter the kind of topping used Spcinies Enter the price for the topping: 5 1: Candy 2. Cookie 3. lce Croam 4: Sunday What would you like to add to the croer? (1. A. Encer for done): 1. Dessert Shop Part 5: Overriding Methods Changes to Receipt If your implementation of reseipt,mes. seceiperi is eorrect, you should not heve to modify it. But as you can see trom the example above, we have new information to include in our receipt. Grading There is no partial credi for individual features. it any of them do not work. the maximum score for the project is 508 . Rubric printing happens only in main or input functions methods implemented correctly as directed above output to the console prints comeneseparated values on a line like the example shown. lce Cream Sundae output has two ines like the example table shows. automated regression tests all still pase

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

More Books

Students also viewed these Databases questions

Question

=+ Do you think a person is less blameworthy for

Answered: 1 week ago