publicPancakeHouseMenu(){ menuItems = new ArrayList<MenuItem>(); addItem("K&B's Pancake Breakfast", "Pancakes with scrambled eggs and toast", true, 2.99); addItem("Regular Pancake Breakfast", "Pancakes with fried eggs, sausage", false, 2.99); addItem("Blueberry Pancakes", "Pancakes made with fresh blueberries", true, 3.49); addItem("Waffles", "Waffles with your choice of blueberries or strawberries", true, 3.59); }
publicDinerMenu(){ menuItems = new MenuItem[MAX_ITEMS]; addItem("Vegetarian BLT", "(Fakin') Bacon with lettuce & tomato on whole wheat", true, 2.99); addItem("BLT", "Bacon with lettuce & tomato on whole wheat", false, 2.99); addItem("Soup of the day", "Soup of the day, with a side of potato salad", false, 3.29); addItem("Hotdog", "A hot dog, with sauerkraut, relish, onions, topped with cheese", false, 3.05); // a couple of other Diner Menu items added here }
publicvoidaddItem(String name, String description, boolean vegetarian, double price){ MenuItem menuItem = new MenuItem(name, description, vegetarian, price); if (numberOfItems >= MAX_ITEMS) { System.err.println("Sorry, menu is full! Can't add item to menu"); } else { menuItems[numberOfItems] = menuItem; numberOfItems = numberOfItems + 1; } }
public MenuItem[] getMenuItems() { return menuItems; }