Repository navigation
Expand file tree
/
Copy pathTestClass.java
More file actions
191 lines (162 loc) · 6.12 KB
/
Copy pathTestClass.java
File metadata and controls
191 lines (162 loc) · 6.12 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
package ECommerceApplication;
public class TestClass {
public static void main(String[] args) {
CreditCard creditCard_1 = new CreditCard(
"2345 5678 6789 0000",
"GULFEM SOLAK",
"145",
"09/27",
"creditCard1"
);
CreditCard creditCard_2 = new CreditCard(
"7894 5234 6789 4566",
"HEVAL SOGUT",
"231",
"03/29",
"creditCard2"
);
CreditCard creditCard_3 = new CreditCard(
"4219 3564 6764 4457",
"LUCY ANDERSON",
"219",
"03/28",
"creditCard3"
);
CreditCard creditCard_4 = new CreditCard(
"1029 3948 4857 5867",
"YAĞMUR BAKIR",
"272",
"06/27",
"creditCard4"
);
User user_1 = new User(
"gulfemsolak",
"Gülfem",
"Solak",
"20/07/2004",
"46695629gS",
"gulfemsolak@gmail.com",
"26 St. Manisa/Yunusemre",
"24 St. Manisa/Yunusemre",
creditCard_1
);
User user_2 = new User(
"hevalsogut",
"Heval",
"Söğüt",
"20/10/2003",
"29355400hG",
"hevalsogut@gmail.com",
"67 St. Manisa/Yunusemre",
"29 St. Manisa/Şehzadeler",
creditCard_2
);
User user_3 = new User(
"lucyanderson",
"Lucy",
"Anderson",
"15/05/1998",
"34985623aL",
"lucyanderson@outlook.com",
"45 St. Brooklyn, NY",
"57 St. Manhattan, NY",
creditCard_3
);
User user_4 = new User(
"yagmurbakir",
"Yağmur",
"Bakır",
"01/03/2004",
"6589626fdk",
"yagmurbakir04@hotmail.com",
"78 St. IZMIR/KONAK",
"95 St. IZMIR/KONAK",
creditCard_4
);
Product TV = new Product(
"LG TV",
"Dark",
"Technology",
400,
15,
"This TV has 2 years guarentee and it has internet connection and screan share property from other devices."
);
Product BluetoothHeadphone = new Product(
"JBL TUNE560BT",
"White",
"Technology",
100,
0.9,
"Provides a good music experience with bass quality."
);
Product Table = new Product(
"WOOD TABLE",
"Wood",
"Furniture",
2,
12,
"It is suitable for studying."
);
Product SweatShirt = new Product(
"LEVIS SWEATSHIRT",
"Blue",
"Clothes",
250,
1.2,
"This product is %90 Coton,%10 Polyester"
);
Product SmartPhone = new Product(
"iPhone 13",
"Space Gray",
"Technology",
100,
5,
"Latest iPhone model with A15 Bionic chip and dual-camera system."
);
Product CoffeeMaker = new Product(
"Coffee Machine",
"Red",
"Home Appliances",
120,
20,
"It provides multiple cup sizes and strong brew option."
);
Order TVOrder = new Order(user_1, TV, creditCard_1,1);
Order BluetoothHeadphoneOrder = new Order(user_2,BluetoothHeadphone ,creditCard_2,2);
Order SweatShirtOrder= new Order(user_2,SweatShirt,creditCard_2,3);
Order TableOrder= new Order(user_3,Table,creditCard_3,4);
Order CoffeeMakerOrder = new Order(user_4,CoffeeMaker,creditCard_4,1);
TVOrder.processOrder();
BluetoothHeadphoneOrder .processOrder();
SweatShirtOrder.processOrder();
TableOrder.processOrder();
CoffeeMakerOrder.processOrder();
user_1.AddFavouriteProduct(TV);
user_2.AddFavouriteProduct(SweatShirt);
user_4.AddFavouriteProduct(SmartPhone);
System.out.println("========================================");
System.out.println("************ Order Summary ************");
System.out.println("User: " + user_1.getUsername());
System.out.println("Ordered Product: " + TV.getName());
System.out.println("---------------------------------------");
System.out.println("User: " + user_2.getUsername());
System.out.println("Ordered Product: " + BluetoothHeadphone.getName());
System.out.println("---------------------------------------");
System.out.println("User: " + user_2.getUsername());
System.out.println("Ordered Product: " + SweatShirt.getName());
System.out.println("---------------------------------------");
System.out.println("User: " + user_4.getUsername());
System.out.println("Ordered Product: " + CoffeeMaker.getName());
System.out.println("========================================");
System.out.println("************ Favourites ************");
System.out.println("User: " + user_1.getUsername());
System.out.println("Favourite Product: " + TV.getName());
System.out.println("---------------------------------------");
System.out.println("User: " + user_2.getUsername());
System.out.println("Favourite Product: " + SweatShirt.getName());
System.out.println("---------------------------------------");
System.out.println("User: " + user_4.getUsername());
System.out.println("Favourite Product: " + SmartPhone.getName());
System.out.println("---------------------------------------");
}
}