Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Order:
- """This class is used to obtain an order for a pizza
- from a customer it starts with a size"""
- def size(self):
- self.size = str(input("Please enter the size of your pizza: small, medium or large: "))
- if self.size == "small":
- self.size = "small"
- elif self.size == "medium":
- self.size = "medium"
- elif self.size == "large":
- self.size = "large"
- else:
- self.size = "small"
- return self.size
- def crust(self):
- self.type = int(input("Enter 1 for regular crust and 2 for thin crust: "))
- if self.type == 1:
- self.new_crust = "regular crust"
- elif self.type == 2:
- self.new_crust = "thin crust"
- return self.new_crust
- def cheese(self):
- self.ans = input("Would you like cheese?(y/n): ")
- if self.ans == 'y':
- self.type = input("Enter 1 for cheddar, 2 for mozzarella, 3 for provolone, 4 for romano: ")
- if self.type == 1:
- self.cheese = "cheddar"
- elif self.type == 2:
- self.cheese = "mozzarella"
- elif self.type == 3:
- self.cheese = "provolone"
- elif self.type == 4:
- self.cheese = "romano"
- else:
- self.cheese = "no cheese"
- return self.cheese
- def peppers(self):
- if self.ans == 'y':
- self.type = input("Enter 1 for bell peppers, 2 for jalapeno, 3 for habanero: ")
- if self.type == 1:
- self.peppers = "bell peppers"
- elif self.type == 2:
- self.peppers = "jalapeno"
- elif self.type == 3:
- self.peppers = "habanero"
- else:
- self.peppers = "no peppers"
- return self.peppers
- def bacon(self):
- if self.ans == 'y':
- self.type = input("Enter 1 for canadian bacon, 2 for side bacon: ")
- if self.type == 1:
- self.bacon = "canadian bacon"
- elif self.type == 2:
- self.bacon = "side bacon"
- else:
- self.bacon = "no bacon"
- return self.bacon
- def output(self, toppings):
- print("Thank You.", "Your order is as follows:")
- print("You ordered a ", toppings[0], toppings[1], " pizza.")
- print("Toppings: ", toppings[2], toppings[3], " and ", toppings[4],".")
- print("Thank you for choosing MR. BIGGS PIZZA PLACE")
- print("Your order is on its way.")
- def run(self):
- #print(len(self.pizza))
- self.new_size = self.size()
- self.new_crust = self.crust()
- self.new_cheese = self.cheese()
- self.new_peppers = self.peppers()
- self.new_bacon = self.bacon()
- self.pizza = [self.new_size, self.new_crust, self.new_cheese, self.new_peppers, self.new_bacon]
- self.output(self.pizza)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement