forked from angiejones/java-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTasteTester.java
More file actions
22 lines (17 loc) · 820 Bytes
/
Copy pathTasteTester.java
File metadata and controls
22 lines (17 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package exercises.chapter9;
public class TasteTester {
public static void main(String[] args){
Cake cake = new Cake("chocolate");
cake.setPrice(29.99);
System.out.println("Cake flavor: " + cake.getFlavor());
System.out.println("Cake price: " + cake.getPrice());
BirthdayCake birthdayCake = new BirthdayCake();
birthdayCake.setPrice(49.95);
System.out.println("Birthday cake flavor: " + birthdayCake.getFlavor());
System.out.println("Birthday cake price: " + birthdayCake.getPrice());
WeddingCake weddingCake = new WeddingCake();
weddingCake.setFlavor("pina colada");
System.out.println("Wedding cake flavor: " + weddingCake.getFlavor());
System.out.println("Wedding cake price: " + weddingCake.getPrice());
}
}