Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please help me with the code? Thanks a lot. Problem In this part of the project, you add the ability to calculate the

Can you please help me with the code?
Thanks a lot.
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Problem In this part of the project, you add the ability to calculate the cost of any Dessertitem along with the associated tax. Also add the ability in the Order class to calculate the cost of all items in the order as well as the associated tax. Last, we provide example code from Geeks for Geeks that will generate a PDF copy of the receipt using the reportlab module. An example PDF receipt is also provided. You will modify the example code to generate the receipt we want, and overwrite the file To do this, you will make updates to your Dessert Shop system as described below. You can cut and paste your code into the files provided or upload copies with the same name to replace with your existing files from Part 2. Changes to Dessertltem Class - make it an abstract class - add attribute tax_percent with the default value 7.25. - add a new abstract method, calculate_cost() - include a new method calculate_tax() that calculates and returns the actual tax for the item Changes to All Dessert Classes Candy, Cookie, IceCream, Sundae - add a method calculate_cost() that overrides the superclass method and returns Changes to All Dessert Classes Candy, Cookie, lceCream, Sundae - add a method calculate_cost() that overrides the superclass method and returns the correct cost for the item - Note: The cost of a Sundae is the cost of the ice cream plus the cost of the topping Changes to Order Class - add a new method, order_cost(), that calculates and returns the total cost for all items in the order - add a new method, order_tax(), calculates and returns the total tax for all items in the order Changes to receipt module - put all the code in a function No global code. - pass as a parameter to the function, instead of it being a global constant - pass the destination file name as a parameter to the function This function will be called at the end of in module. Changes to dessertshop module - add a loop to main that generates the list-of-lists required by the receipt module to generate the receipt. Each row in the list includes the name of the dessert, the cost of each item and the tax for each item. Values should match what is shown in the example scenario below. - add a row for subtotal of all the items in the order and the total tax for the order as shown in the scenario - add a row for the total cost for the order (subtotal + total tax) - add a row for the total number of items in the order as shown in the example - call from Changes to Test Cases - Modify the Dessertitem test code to use an instance of the Candy class. Because Dessertitem is now an abstract class, you can only create objects of a concrete subclass type directly. So you have to test the base class through a concrete subclass. - Add new test cases to Dessertltem test code that test the tax percent attribute - Add new test cases to test method calculate_cost for each respective dessert subclass. - Add new test cases to test superclass method calculate_tax for each respective dessert subclass. Hint: We've given you an example receipt and example objects created in main()... Even though you have written and modified test cases to evaluate your code, it is Problem In this part of the project, you add the ability to calculate the cost of any Dessertitem along with the associated tax. Also add the ability in the Order class to calculate the cost of all items in the order as well as the associated tax. Last, we provide example code from Geeks for Geeks that will generate a PDF copy of the receipt using the reportlab module. An example PDF receipt is also provided. You will modify the example code to generate the receipt we want, and overwrite the file To do this, you will make updates to your Dessert Shop system as described below. You can cut and paste your code into the files provided or upload copies with the same name to replace with your existing files from Part 2. Changes to Dessertltem Class - make it an abstract class - add attribute tax_percent with the default value 7.25. - add a new abstract method, calculate_cost() - include a new method calculate_tax() that calculates and returns the actual tax for the item Changes to All Dessert Classes Candy, Cookie, IceCream, Sundae - add a method calculate_cost() that overrides the superclass method and returns Changes to All Dessert Classes Candy, Cookie, lceCream, Sundae - add a method calculate_cost() that overrides the superclass method and returns the correct cost for the item - Note: The cost of a Sundae is the cost of the ice cream plus the cost of the topping Changes to Order Class - add a new method, order_cost(), that calculates and returns the total cost for all items in the order - add a new method, order_tax(), calculates and returns the total tax for all items in the order Changes to receipt module - put all the code in a function No global code. - pass as a parameter to the function, instead of it being a global constant - pass the destination file name as a parameter to the function This function will be called at the end of in module. Changes to dessertshop module - add a loop to main that generates the list-of-lists required by the receipt module to generate the receipt. Each row in the list includes the name of the dessert, the cost of each item and the tax for each item. Values should match what is shown in the example scenario below. - add a row for subtotal of all the items in the order and the total tax for the order as shown in the scenario - add a row for the total cost for the order (subtotal + total tax) - add a row for the total number of items in the order as shown in the example - call from Changes to Test Cases - Modify the Dessertitem test code to use an instance of the Candy class. Because Dessertitem is now an abstract class, you can only create objects of a concrete subclass type directly. So you have to test the base class through a concrete subclass. - Add new test cases to Dessertltem test code that test the tax percent attribute - Add new test cases to test method calculate_cost for each respective dessert subclass. - Add new test cases to test superclass method calculate_tax for each respective dessert subclass. Hint: We've given you an example receipt and example objects created in main()... Even though you have written and modified test cases to evaluate your code, it is

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_2

Step: 3

blur-text-image_3

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

1. Signs and symbols of the map Briefly by box ?

Answered: 1 week ago

Question

Types of physical Maps?

Answered: 1 week ago

Question

Explain Intermediate term financing in detail.

Answered: 1 week ago