static void Main(string[] args)
        {
            PancakeHouseMenu phm = new PancakeHouseMenu();
            ArrayList breakfastItems = phm.getMenuItems();
            DinnerMenu dm = new DinnerMenu();
            MenuItem[] lunchItems = dm.getMenuItems();

            for (int i = 0; i < breakfastItems.Count; i++)
            {
                MenuItem menuItem = (MenuItem)breakfastItems[i];
                Console.WriteLine(menuItem.getName());
            }

            for (int j = 0; j < lunchItems.Length; j++)
            {
                MenuItem menuItem = lunchItems[j];
                Console.WriteLine(menuItem.getName());
            }

            //New 1
            PancakeHouseMenu phMenu2 = new PancakeHouseMenu();
            DinnerMenu dMenu2 = new DinnerMenu();
            Waitress waitress = new Waitress(phMenu2, dMenu2);
            waitress.printMenu();

            //New 2

            string z = Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            MenuComponent allMenus = new Menu("All Menus", "All Menus combined");
            MenuComponent phMenu = new Menu("Pancake Menu", "Breakfast");
            MenuComponent dMenu = new Menu("Dinner Menu", "Dinner");
            MenuComponent dessert = new Menu("Dessert Menu","Dessert");

            allMenus.Add(phMenu);
            allMenus.Add(dMenu);

            phMenu.Add(new MenuItem("dinner 1", 3.00)); //adding a menuitem to breakfast

            dMenu.Add(dessert); //Adding a SubMenu to a Menu

            dessert.Add(new MenuItem("dessert 1", 4.00));

            Waitress w = new Waitress(allMenus);
            w.printMenu();

            string z = Console.ReadLine();
        }
        static void Main(string[] args)
        {
            PancakeHouseMenu phMenu2 = new PancakeHouseMenu();
            DinnerMenu dMenu2 = new DinnerMenu();

            ArrayList menus = new ArrayList();
            menus.Add(phMenu2); menus.Add(dMenu2);
            Waitress waitress = new Waitress(menus);
            waitress.printMenu();

            string z = Console.ReadLine();
        }
        static void Main(string[] args)
        {
            PancakeMenu p = new PancakeMenu(); DinnerMenu d = new DinnerMenu();
            ArrayList aw = new ArrayList() { p,d};
            Waitress w = new Waitress(aw);
            w.printMenu();

            string z = Console.ReadLine();
        }