-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMenuTestDrive.java
More file actions
35 lines (28 loc) · 1012 Bytes
/
MenuTestDrive.java
File metadata and controls
35 lines (28 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package component;
import component.impl.Menu;
import component.impl.MenuItem;
/**
* Created by http://teachcourse.cn on 2018/03/22.
*/
public class MenuTestDrive {
public static void main(String[] args) {
MenuComponent pancakeHouseMenu = new Menu("PANCAKE HOUSE MENU",
"Breakfast");
MenuComponent dinerMenu = new Menu("DINER MENU", "Lunch");
MenuComponent cafeMenu = new Menu("CAKE MENU", "Dinner");
MenuComponent desserMenu = new Menu("DESSERT MENU", "Dessert of course");
MenuComponent allMenus = new Menu("ALL MENUS", "All menus combined");
allMenus.add(pancakeHouseMenu);
allMenus.add(dinerMenu);
allMenus.add(cafeMenu);
dinerMenu.add(new MenuItem("Pasta",
"Spaghetti with Marinara Sauce,and a slice of sourdough bread",
true, 3.89));
dinerMenu.add(desserMenu);
desserMenu.add(new MenuItem("Apple Pie",
"Apple pie with a flakey crust,topped with vanilla ice cream",
true, 1.59));
Waitress waitress = new Waitress(allMenus);
waitress.printMenu();
}
}