1+ from Menu import Menu
2+ from MenuComponent import MenuComponent
3+ from MenuItem import MenuItem
4+ from Waitress import Waitress
5+
6+
7+ class MenuTestDrive :
8+ @staticmethod
9+ def main (* args ):
10+ pancakeHouseMenu : MenuComponent = Menu ("PANCAKE HOUSE MENU" , "Breakfast" )
11+ dinerMenu : MenuComponent = Menu ("DINER MENU" , "Lunch" )
12+ cafeMenu : MenuComponent = Menu ("CAFE MENU" , "Dinner" )
13+ dessertMenu : MenuComponent = Menu ("DESSERT MENU" , "Dessert of course!" )
14+ coffeeMenu : MenuComponent = Menu ("COFFEE MENU" , "Stuff to go with your afternoon coffee" )
15+
16+ allMenus : MenuComponent = Menu ("ALL MENUS" , "All menus combined" )
17+
18+ allMenus .add (pancakeHouseMenu )
19+ allMenus .add (dinerMenu )
20+ allMenus .add (cafeMenu )
21+
22+ pancakeHouseMenu .add (MenuItem ( "K&B's Pancake Breakfast" , "Pancakes with scrambled eggs and toast" , True , 2.99 ))
23+ pancakeHouseMenu .add (MenuItem ( "Regular Pancake Breakfast" , "Pancakes with fried eggs, sausage" , False , 2.99 ))
24+ pancakeHouseMenu .add (MenuItem ( "Blueberry Pancakes" , "Pancakes made with fresh blueberries and blueberry syrup" , True , 3.49 ))
25+ pancakeHouseMenu .add (MenuItem ( "Waffles" , "Waffles with your choice of blueberries or strawberries" , True , 3.59 ))
26+
27+ dinerMenu .add (MenuItem ( "Vegetarian BLT" , "(Fakin') Bacon with lettuce & tomato on whole wheat" , True , 2.99 ))
28+ dinerMenu .add (MenuItem ( "BLT" , "Bacon with lettuce & tomato on whole wheat" , False , 2.99 ))
29+ dinerMenu .add (MenuItem ( "Soup of the day" , "A bowl of the soup of the day, with a side of potato salad" , False , 3.29 ))
30+ dinerMenu .add (MenuItem ( "Hot Dog" , "A hot dog, with saurkraut, relish, onions, topped with cheese" , False , 3.05 ))
31+ dinerMenu .add (MenuItem ( "Steamed Veggies and Brown Rice" , "A medly of steamed vegetables over brown rice" , True , 3.99 ))
32+ dinerMenu .add (MenuItem ( "Pasta" , "Spaghetti with marinara sauce, and a slice of sourdough bread" , True , 3.89 ))
33+ dinerMenu .add (dessertMenu )
34+
35+ dessertMenu .add (MenuItem ( "Apple Pie" , "Apple pie with a flakey crust, topped with vanilla icecream" , True , 1.59 ))
36+ dessertMenu .add (MenuItem ( "Cheesecake" , "Creamy New York cheesecake, with a chocolate graham crust" , True , 1.99 ))
37+ dessertMenu .add (MenuItem ( "Sorbet" , "A scoop of raspberry and a scoop of lime" , True , 1.89 ))
38+
39+ cafeMenu .add (MenuItem ( "Veggie Burger and Air Fries" , "Veggie burger on a whole wheat bun, lettuce, tomato, and fries" , True , 3.99 ))
40+ cafeMenu .add (MenuItem ( "Soup of the day" , "A cup of the soup of the day, with a side salad" , False , 3.69 ))
41+ cafeMenu .add (MenuItem ( "Burrito" , "A large burrito, with whole pinto beans, salsa, guacamole" , True , 4.29 ))
42+
43+ cafeMenu .add (coffeeMenu )
44+
45+ coffeeMenu .add (MenuItem ("Coffee Cake" , "Crumbly cake topped with cinnamon and walnuts" , True , 1.59 ))
46+ coffeeMenu .add (MenuItem ("Bagel" , "Flavors include sesame, poppyseed, cinnamon raisin, pumpkin" , False , 0.69 ))
47+ coffeeMenu .add (MenuItem ("Biscotti" , "Three almond or hazelnut biscotti cookies" , True , 0.89 ))
48+
49+ waitress : Waitress = Waitress (allMenus )
50+
51+ waitress .printMenu () # book's example
52+
53+ if __name__ == "__main__" :
54+ MenuTestDrive .main ()
0 commit comments