[SOLVED] SOLVED: pizza class and PizzaStore class

25.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon pizzaSolution.zip (22.7 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
đź”’ Securely Powered by:
Secure Checkout
4.7/5 - (11 votes)

Create a class named pizza that stores the following information about a single pizza:1. pizza brand (only two brands: Pizza Hut or Domino’s) 2. size (two sizes are available: small or large) 3. number of toppings The class pizza should contain the followings:

â—Ź accessor methods (get methods) to get the instance variables (attributes).

â—Ź mutator methods (set methods) to set the instance variables (attributes).

â—Ź a method named calculateCost() which returns a float that is the cost of the pizza. Pizza cost is determined by: â—‹ Pizza Hut:

â–  small: $10 + $1 per topping,

■ large: $14 + $3 per topping ○ Domino’s

â–  small: $12 + $2 per topping

â–  large: $16 + $3 per topping

● a method __str__(self) that returns the size, number of toppings and the cost of the pizza. Your main method (section) looks like this: p1 = Pizza (“Pizza Hut”, “small”, 3) print (p1) p2 = Pizza (“Domino’s”, “large”, 2) print (p2) The result should look like this: Pizza Hut; Small Pizza; Cost is $13 Domino’s; Large Pizza; Cost is $22

Create another class named PizzaStore. The class PizzaStore (sells all kinds of pizza brands) has the following attributes (instance variables):

â—Ź Name of the store

â—Ź List of pizza orders received. The class has the following methods:

â—Ź __init__ â—Ź orderReceived (pizza)

● __str__ The main section should look like this: p1 = Pizza (“Pizza Hut”, small, 3) p2 = Pizza (“Domino’s”, large, 2) s1 = PizzaStore(“Pizza House”) s1.orderReceived(p1) s1.orderRecevied(p2) print(s1) The result (output) should look like: Pizza House has received the following order: small size, 3 toppings, Pizza Huts; large size, 2 toppings, Domino’s

  • pizzaSolution.zip