class Restaurant: def __init__(self, orders): self.orders = orders def show_avail_pizza(self): print('You are in for a treat! Pizzaria Has The Following Today:') print(' * * * * * * * * *') for order, customer in self.orders.items(): if customer == 'Free': print(order) def sell_pizza(self, chosen_pizza, name): if self.orders[chosen_pizza] == 'Free': print( f'{chosen_pizza} has been checked out for you by our lovely online staff.' ) self.orders[chosen_pizza] = name return True else: print( f'Sorry, you just purchased a {chosen_pizza}. Please buy a different kind!' ) return False def returned_pizza(self, returned_pizza): self.orders[returned_pizza] = 'Free' print(f'Congrats! Thanks for returning {returned_pizza}') class Buyer: def __init__(self, name, restaurant): self.name = name self.orders = [] self.restaurant = restaurant def view_borrowedpizza(self): if not self.orders: print('You haven\'t bought any pizzas today. Order now and enjoy delicious pizza. :) ') else: for order in self.orders: print(order) def chosen_pizza(self): order = input( 'You have seen the pizzas :) . Now, enter your preferred order!>> ') if self.restaurant.sell_pizza(order, self.name): self.orders.append(order) def returned_pizza(self): order = input( 'You have spotted a Mystery Pizza! Enter the name of the pizza >> ') if order in self.orders: self.restaurant.returned_pizza(order) else: print('You haven\'t bought that pizza today, try again some other time.') def create_res(): orders = { 'Pepperoni Pizza': 'Free', 'Mushroom Pizza': 'Free', 'Chicken Pizza': 'Free' } restaurant = Restaurant(orders) buyer_example = Buyer('Your Name', restaurant) while True: print(''' ****************... PIZZARIA ONLINE...********************* Hey there :) . Welcome to Pizzaria Online. Kindly choose an option to proceed. 1. Show Today's Menu 2. Place My Order 3. Return 'Mystery Pizza' 4. View My Purchases 5. Exit''' ) choice = int(input('Enter Option: ')) if choice == 1: print() restaurant.show_avail_pizza() elif choice == 2: print() buyer_example.chosen_pizza() elif choice == 3: print() buyer_example.returned_pizza() elif choice == 4: print() buyer_example.view_borrowedpizza() elif choice == 5: print('Goodbye! Thanks for visiting Pizzaria! See you soon') print('This week is Mystery week. You have just won a sample of your receipt from a year ago!') print(' ') pizzaname = "PIZZA VILLA ~ FANCY RECEIPT" p = pizzaname.center(65, ".") print(p) symbol = "#################################################################" print(symbol) print(" ") paape = "Italian Pizza Restaurant" peR = paape.center(65, " ") print(peR) pappe = "TEL -- +233 455 333 4322, FAX -- 03 090 304 292" peS = pappe.center(65, " ") print(peS) pape = "401 Accra Street" pe = pape.center(65, " ") print(pe) print(" ") symbol = "*******************************************************************" print(symbol) a= "CASHIER ~ ANNA ADU TABLE 34" b= "Order 109" c="20th June, 2023 --- 12:15" print(a) print(b.rjust(65)) print(c.rjust(65)) symbol = "*******************************************************************" print(symbol) print(" ") from tabulate import tabulate dataffe = ["Esther Adu", "1 Nutty Vegan Pizza, 1 Bottle of Nuts", "Small", "$20.00"], ["Fred Adu","1 Mushroom Delight, 1 Coke", "Small", "$30.00"], ["Mama Adu", "2 Pepperoni Special, 2 Iced Teas", "Large", "$60.00"], ["Papa Earl", "1 Extra Queasy Salami Pizza", "Extra Large", "$60.00" ] column_names = ["Name", "Order", "Size", "Cost"] print(tabulate(dataffe, headers=column_names, tablefmt="fancy_grid")) print(" ") print(" ") Total_in_Dollars= " TOTAL: $170.00" print(Total_in_Dollars.rjust(65)) print(" ") print(" ") s="CUSTOMER LIST ~~~ 22/06/23 ~~~ 12 :15" print(s.center(65,".")) print(" ") class Fam: name = "" status = 0 relation = "" bike1 = Fam() bike2 = Fam() bike3 = Fam() bike4 = Fam() bike1.status = "Vegeterian" bike1.name = "Esther Adu" bike1.relation = "Sister" bike2.status = "Lactose-Intolerant" bike2.name = "Fred Adu" bike2.relation = "Brother" bike3.status = "Tomato-free" bike3.name = "Mama Adu" bike3.relation = "Mother" bike4.status = "None" bike4.name = "Earl Adu" bike4.relation = "Father" print(f"Name: {bike1.name}, Food Status: {bike1.status}, Relation: {bike1.relation} ") print(f"Name: {bike2.name}, Food Status: {bike2.status}, Relation: {bike2.relation} ") print(f"Name: {bike3.name}, Food Status: {bike3.status}, Relation: {bike3.relation} ") print(f"Name: {bike4.name}, Food Status: {bike4.status}, Relation: {bike4.relation} ") print(" ") a="OBSERVATIONS FROM CASHIER BROWN ABOUT ADU FAMILY:" print(a.center(65),".") print(" ") Esther_Budget = 20 Esther_Meal = 20 if Esther_Meal > Esther_Budget: print("Esther borrowed money for the meal") elif Esther_Meal == Esther_Budget: print(" * Esther could pay for the meal") else: print("Esther has more than enough for the meal") Fred_Budget = 20 Fred_Meal = 30 if Fred_Meal > Fred_Budget: print(" * Fred borrowed money for the meal") elif Fred_Meal == Fred_Budget: print("Fred could pay for the meal") else: print(" has more than enough for the meal") Mama_Budget = 100 Mama_Meal = 60 if Mama_Meal > Mama_Budget: print("Mama borrowed money for the meal") elif Fred_Meal == Fred_Budget: print("Mama enough to pay for the meal") else: print(" * Mama had more than enough money for the meal") Papa_Budget = 60 Papa_Meal = 60 if Papa_Meal > Papa_Budget: print("Mama borrowed money for the meal") elif Papa_Meal == Papa_Budget: print(" * Papa had exactly enough to pay for the meal") else: print(" * Mama had more than enough money for the meal") print(" ") print("Amount Esther Paid = $20.00") print("Amount Fred Paid = $30.00") #Borrowed $10.00 from Mama print("Amount Mama Paid = $60.00") print("Amount Papa Paid = $60.00") print(" ") a="THANK YOU FOR STOPPING BYE!" b="SEE YOU SOON!" print(a.center(60)) print(b.center(60)) symbol = "#################################################################" print(symbol) exit() if __name__ == '__main__': create_res()