-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathPizza.java
More file actions
46 lines (37 loc) · 1.08 KB
/
Pizza.java
File metadata and controls
46 lines (37 loc) · 1.08 KB
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
36
37
38
39
40
41
42
43
44
45
46
package PizzaStore;
import java.util.ArrayList;
/**
*
* @author stefano
*/
public abstract class Pizza {
// each pizza has a:
String name;
String dough;
String sauce;
ArrayList toppings = new ArrayList();
void prepare() {
// the abstract class provides some basics defaults for baking,
// cutting and boxing
// preparation follows a number of steps in a particular sequence
System.out.println("Preparing " + name);
System.out.println("Tossing dough...");
System.out.println("Adding sauce...");
System.out.println("Adding toppings: ");
for(int i = 0; i < toppings.size(); i++) {
System.out.println(" " + toppings.get(i));
}
}
void bake() {
System.out.println("Bake for 25 minutes at 350");
}
void cut() {
System.out.println("Cutting the pizza into diagonal slices");
}
void box() {
System.out.println("Place pizza in official PizzaStore box");
}
public String getName() {
return name;
}
}