Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

code the purchaseable order and builder class. Assignment Instructions For this assignment, you will be creating classes based on the UML diagram below. One class,

code the purchaseable order and builder class. Assignment Instructions
For this assignment, you will be creating classes based on the UML diagram below. One class, the Pizza class, has code included in the instructions that you can use. Additional Information:
To be able to use the Purchasable class (and its subclasses) as a key in a dictionary it will be necessary to override the __eq__ and __hash__ methods within that class. The __eq__ method can consider two Purchasables equivalent if they have the same name and the same cost. The __hash__ method can return a hash (use Python's hash function) of a tuple containing the name and cost of the purchasable.
You should create all of the other classes described in the UML Diagram. Sodas can have two sizes ('20 oz' and '2 Liter') and can be one of these flavors: 'Coke', 'Sprite', 'Mt. Dew', 'Root Beer', 'Orange', 'Grape'. For calculating the cost of a soda, the base cost for a '20 oz' Soda is $1.50 and for a '2 Liter' $2.50 and an additional $0.50 if it's a premium Soda which is one of 'Coke', 'Sprite', or 'Mt. Dew'.
For the PizzaFactory class you can broadly decide the exact toppings for the different pizzas. Each factory method should assign a name to the constructed Pizza object so that it doesn't have the "Custom Size Pizza" name assigned to it.
The LineItemIterator class for the Order class should iterate over lines in an order and produce output that looks similar to the following:
image text in transcribed

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

Students also viewed these Databases questions

Question

Technology. Refer to Case

Answered: 1 week ago