Exemplo n.º 1
0
        public void addItem(String name, String description, bool vegetarian, double price)
        {
            MenuItem menuItem = new MenuItem(name, description, vegetarian, price);

            if (numberOfItems >= MAX_ITEMS)
            {
                Console.WriteLine("Sorry, menu is full! Can't add item to menu.");
            }
            else
            {
                menuItems[numberOfItems] = menuItem;
                numberOfItems = numberOfItems + 1;
            }
        }
 public DinerMenuIterator(MenuItem[] items)
 {
     this.items = items;
 }
 public void addItem(String name, String description, bool vegetarian, double price)
 {
     MenuItem menuItem = new MenuItem(name, description, vegetarian, price);
     menuItems.Add(menuItem);
 }