-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sales.java
52 lines (41 loc) · 1.33 KB
/
Sales.java
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
47
48
49
50
51
52
import java.util.ArrayList;
import javax.swing.JOptionPane;
public class Sales
{
public static void main(String[] args)
{
String message = "";
ArrayList<Customer> customerArray = new ArrayList<Customer>();
Customer c1 = new Customer("Davis ",
new Address("Cooper Street", "Arlington", "Texas", 76019),
65783);
Customer c2 = new Customer("Jones",
new Address("Fifth Street", "Dallas", "Texas", 76000),
11123);
c1.addToProductList(new Music("Meet Bach", 0.99,
new Date(1, 5, 2010),
Music.GenreType.CLASSICAL, "Bach", 5 ));
c1.addToProductList(new Music("Rihanna", 1.29,
new Date(6,5,2010),
Music.GenreType.ROCK, "Rihanna", 8 ));
c1.addToProductList(new App("Tennis", 9.99,
new Date(3,18,2010),
App.AppType.GAME, "Ubisoft"));
customerArray.add(c1);
c2.addToProductList(new Music( "For the Road", .99,
new Date(2,8,2010),
Music.GenreType.COUNTRY, "Swift", 12));
c2.addToProductList(new App("Learn Java", 5.99,
new Date(9,1,2010),
App.AppType.EDUCATION, "Adobe"));
c2.addToProductList(new App("Pages", 9.99,
new Date(5,30,2010),
App.AppType.PRODUCTIVITY, "Apple"));
customerArray.add(c2);
for(Customer c: customerArray)
{
message += c.createHistory();
}
JOptionPane.showMessageDialog(null, message, "Purchase History", JOptionPane.PLAIN_MESSAGE);
}
}