-
Notifications
You must be signed in to change notification settings - Fork 0
/
fasionOp.java
551 lines (535 loc) · 20.1 KB
/
fasionOp.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
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
import java.util.ArrayList;
import java.util.Scanner;
class fashion{
Scanner in=new Scanner(System.in);
private String brand;
private String Type;
private int size;
private Double price;
private String sizes;
ArrayList<String> brands= new ArrayList<String>(2);
ArrayList<Integer> Sizes = new ArrayList<Integer>(3);
ArrayList<Double> Prices = new ArrayList<Double>(3);
ArrayList<String> Size = new ArrayList<String>(3);
static ArrayList<String> CartItem = new ArrayList<String>(4);
static ArrayList<Double> CartPrices = new ArrayList<Double>(4);
public String getbrand()
{
return brand;
}
public void setbrand(String Brand) {
this.brand=Brand;
}
public void setType(String B)
{
this.Type=B;
}
public String getType()
{
return Type;
}
public int getsize()
{
return size;
}
public void setsize(int Size) {
this.size=Size;
}
public Double getprice()
{
return price;
}
public void setprice(double i) {
this.price=i;
}
public String getsizes()
{
return sizes;
}
public void setsizes(String Sizes) {
this.sizes=Sizes;
}
public void addcart(int x)
{
if (x ==1)
{
OnlineShopping OS=new OnlineShopping ();
System.out.println("To conform to the cart enter : 1 \nTo continue shopping enter :0 ");
System.out.print(">>> ");
int x1 = in.nextInt();
if (x1 ==1)
{
System.out.println("ADDING to the CART\n### Successfully added to cart ###");
System.out.println("");
CartItem.add(getbrand()+" "+getsize());
CartPrices.add(getprice());
ShoppingCartManager SCM=new ShoppingCartManager();
System.out.println("Did you want to go to the cart or continue shopping");
System.out.println("To conform to go to the cart for checkout enter : 1 \nTo continue shopping enter :0 ");
System.out.print(">>> ");
int y = in.nextInt();
if (y==1)
{
SCM.Cart(CartItem,CartPrices);
}
else
{
OS.ReFashion(1);
}
}
else if(x1 ==0)
{
System.out.print("please continue your shopping");
OS.ReFashion(x1);
}
}
}
}
class shirts extends fashion
{
public void shirtproperties(String brand,int size,Double double1) {
super.brands.add(getbrand());
super.Sizes.add(getsize());
super.Prices.add(getprice());
System.out.println("__The Details of the product_");
System.out.println("The brand of the shirt is :" + getbrand());
System.out.println("The size of the shirt is :" + getsize());
System.out.println("The price of the shirt is :" + getprice());
System.out.println("") ;
System.out.println("Do you want the item add to cart ");
System.out.println("To confirm to the cart enter : 1") ;
System.out.println ("To continue shopping enter :0 ");
int cart = in.nextInt();
super.addcart(cart);
}
}
class pants extends fashion{
public void pantproperties(String brand,int size,Double double1) {
super.brands.add(getbrand());
super.Sizes.add(getsize());
super.Prices.add(getprice());
System.out.println("__The Details of the product_");
System.out.println("The brand of the pant is :" + getbrand());
System.out.println("The size of the pant is :" + getsize());
System.out.println("The price of the pant is :" + getprice());
System.out.println("") ;
System.out.println("Do you want the item add to cart ");
System.out.println("To confirm to the cart enter : 1") ;
System.out.println ("To continue shopping enter :0 ");
int cart = in.nextInt();
super.addcart(cart);
}
}
class tshirts extends fashion{
public void tshirtproperties(String brand, String sizes,Double double1) {
super.brands.add(getbrand());
super.Size.add(getsizes());
super.Prices.add(getprice());
System.out.println("__The Details of the product_");
System.out.println("The brand of the tshirt is :" + getbrand());
System.out.println("The size of the tshirt is :" + getsizes());
System.out.println("The price of the tshirt is :" + getprice());
System.out.println("") ;
System.out.println("Do you want the item add to cart ");
System.out.println("To confirm to the cart enter : 1") ;
System.out.println ("To continue shopping enter :0 ");
int cart = in.nextInt();
super.addcart(cart);
}
}
class jackets extends fashion{
public void jacketproperties(String brand,String sizes,Double double1) {
super.brands.add(getbrand());
super.Size.add(getsizes());
super.Prices.add(getprice());
System.out.println("__The Details of the product_");
System.out.println("The brand of the jacket is :" + getbrand());
System.out.println("The size of the jacket is :" + getsizes());
System.out.println("The price of the jacket is :" + getprice());
System.out.println("") ;
System.out.println("Do you want the item add to cart ");
System.out.println("To confirm to the cart enter : 1") ;
System.out.println ("To continue shopping enter :0 ");
int cart = in.nextInt();
super.addcart(cart);
}
}
class shoes extends fashion{
public void shoeproperties(String brand,int size,Double double1) {
super.brands.add(getbrand());
super.Sizes.add(getsize());
super.Prices.add(getprice());
System.out.println("__The Details of the product_");
System.out.println("The brand of the shoe is :" + getbrand());
System.out.println("The size of the shoe is :" + getsize());
System.out.println("The price of the shoe is :" + getprice());
System.out.println("") ;
System.out.println("Do you want the item add to cart ");
System.out.println("To confirm to the cart enter : 1") ;
System.out.println ("To continue shopping enter :0 ");
int cart = in.nextInt();
super.addcart(cart);
}
}
class backpacks extends fashion{
public void backpackproperties(String brand,Double double1) {
super.brands.add(getbrand());
super.Prices.add(getprice());
System.out.println("__The Details of the product_");
System.out.println("The brand of the backpack is :" + getbrand());
System.out.println("The price of the backpack is :" + getprice());
System.out.println("") ;
System.out.println("Do you want the item add to cart ");
System.out.println("To confirm to the cart enter : 1") ;
System.out.println ("To continue shopping enter :0 ");
int cart = in.nextInt();
super.addcart(cart);
}
}
class shorts extends fashion{
public void shortproperties(String brand,String sizes,Double double1) {
super.brands.add(getbrand());
super.Size.add(getsizes());
super.Prices.add(getprice());
System.out.println("__The Details of the product_");
System.out.println("The brand of the shorts is :" + getbrand());
System.out.println("The size of the shorts is :" + getsizes());
System.out.println("The price of the shorts is :" + getprice());
System.out.println("") ;
System.out.println("Do you want the item add to cart ");
System.out.println("To confirm to the cart enter : 1") ;
System.out.println ("To continue shopping enter :0 ");
int cart = in.nextInt();
super.addcart(cart);
}
}
class sarees extends fashion{
public void sareeproperties(String brand,Double double1) {
super.brands.add(getbrand());
super.Prices.add(getprice());
System.out.println("__The Details of the product_");
System.out.println("The brand of the saree is :" + getbrand());
System.out.println("The price of the saree is :" + getprice());
System.out.println("") ;
System.out.println("Do you want the item add to cart ");
System.out.println("To confirm to the cart enter : 1") ;
System.out.println ("To continue shopping enter :0 ");
int cart = in.nextInt();
super.addcart(cart);
}
}
class leggings extends fashion{
public void leggingproperties(String brand,String sizes,Double double1) {
super.brands.add(getbrand());
super.Size.add(getsizes());
super.Prices.add(getprice());
System.out.println("__The Details of the product_");
System.out.println("The brand of the legging is :" + getbrand());
System.out.println("The size of the legging is :" + getsizes());
System.out.println("The price of the legging is :" + getprice());
System.out.println("") ;
System.out.println("Do you want the item add to cart ");
System.out.println("To confirm to the cart enter : 1") ;
System.out.println ("To continue shopping enter :0 ");
int cart = in.nextInt();
super.addcart(cart);
}
}
public class fasionOp extends OnlineShopping
{
public void fashion(String x)
{
OnlineShopping OS=new OnlineShopping ();
Scanner in=new Scanner(System.in);
shirts shirt = new shirts();
pants pant = new pants();
shoes shoe = new shoes();
backpacks backpack = new backpacks();
jackets jacket = new jackets();
tshirts tshirt = new tshirts();
shorts shorts = new shorts();
sarees saree = new sarees();
leggings legging = new leggings();
switch(x.toLowerCase()) {
case "mens":
System.out.println("what type of product do you want");
System.out.println("\nThe available products are\nshirts\npants\ntshirts\njackets\nshorts\nshoes\nbackpacks\n");
String type = in.next();
switch (type.toLowerCase())
{
case "shirts":
System.out.println("Which brand do you want: ");
System.out.println("\nThe available brands are\n1.spykar\n2.uspolo\n");
String brand = in.next();
shirt.setbrand(brand);
switch (brand.toLowerCase())
{
case "spykar":
case"uspolo":
System.out.println("which size you want in cm: ");
System.out.println("\nThe available sizes are\n42\n44\n46\n");
int sizes = in.nextInt();
shirt.setsize(sizes);
switch(sizes)
{
case 42 :
shirt.setprice(1999);
shirt.shirtproperties(shirt.getbrand(), shirt.getsize(),shirt.getprice());
break;
case 44:
shirt.setprice(2299);
shirt.shirtproperties(shirt.getbrand(), shirt.getsize(),shirt.getprice());
break;
case 46:
shirt.setprice(2499);
shirt.shirtproperties(shirt.getbrand(), shirt.getsize(),shirt.getprice());
break;
}
break;
}
break;
}
switch(type.toLowerCase()) {
case "pants":
System.out.println("which brand do you want");
System.out.println("\nThe available brands are\nspykar\nuspolo\n");
String brand = in.next();
pant.setbrand(brand);
switch (brand.toLowerCase())
{
case "spykar":
case "uspolo":
System.out.println("which size you want in : ");
System.out.println("\nThe available sizes are\n28\n30\n32\n");
int sizes = in.nextInt();
pant.setsize(sizes);
switch(sizes)
{
case 28 :
pant.setprice(1999);
pant.pantproperties(pant.getbrand(), pant.getsize(),pant.getprice());
break;
case 30:
pant.setprice(2299);
pant.pantproperties(pant.getbrand(), pant.getsize(),pant.getprice());
break;
case 32:
pant.setprice(2499);
pant.pantproperties(pant.getbrand(), pant.getsize(),pant.getprice());
break;
}
break;
}
break;
}
switch (type.toLowerCase())
{
case "tshirts":
System.out.println("Which Brand you want: ");
System.out.println("\nThe available brands are\nspykar\nuspolo\n");
String brand = in.next();
tshirt.setbrand(brand);
switch (brand.toLowerCase())
{
case "spykar":
case"uspolo":
System.out.println("which size you want in cm: ");
System.out.println("\nThe available sizes are\nm\nl\nxl\n");
String sizes = in.next();
tshirt.setsizes(sizes);
switch(sizes)
{
case "m" :
tshirt.setprice(1999);
tshirt.tshirtproperties(tshirt.getbrand(), tshirt.getsizes(),tshirt.getprice());
break;
case "l":
tshirt.setprice(2499);
tshirt.tshirtproperties(tshirt.getbrand(), tshirt.getsizes(),tshirt.getprice());
break;
case "xl":
tshirt.setprice(2999);
tshirt.tshirtproperties(tshirt.getbrand(), tshirt.getsizes(),tshirt.getprice());
break;
}
break;
}
break;
}
switch (type.toLowerCase())
{
case "jackets":
System.out.println("Which Brand you want: ");
System.out.println("\nThe available brands are\nspykar\nuspolo\n");
String brand = in.next();
jacket.setbrand(brand);
switch (brand.toLowerCase())
{
case "spykar":
case"uspolo":
System.out.println("which size you want in cm: ");
System.out.println("\nThe available sizes are\nm\nl\nxl\n");
String sizes = in.next();
jacket.setsizes(sizes);
switch(sizes)
{
case "m" :
jacket.setprice(1599);
jacket.jacketproperties(jacket.getbrand(),jacket.getsizes(),jacket.getprice());
break;
case "l":
jacket.setprice(1999);
jacket.jacketproperties(jacket.getbrand(),jacket.getsizes(),jacket.getprice());
break;
case "xl":
jacket.setprice(2599);
jacket.jacketproperties(jacket.getbrand(),jacket.getsizes(),jacket.getprice());
break;
}
break;
}
break;
}
switch (type.toLowerCase())
{
case "shoes":
System.out.println("Which Brand you want: ");
System.out.println("\nThe available brands are\nSketchers\nnike\n");
String brand = in.next();
shoe.setbrand(brand);
switch (brand.toLowerCase())
{
case "sketchers":
case"nike":
System.out.println("which size you want in uk system: ");
System.out.println("\nThe available sizes are\n8\n9\n10\n");
int sizes = in.nextInt();
shoe.setsize(sizes);
switch(sizes)
{
case 8 :
shoe.setprice(2999);
shoe.shoeproperties(shoe.getbrand(), shoe.getsize(),shoe.getprice());
break;
case 9:
shoe.setprice(4999);
shoe.shoeproperties(shoe.getbrand(), shoe.getsize(),shoe.getprice());
break;
case 10:
shoe.setprice(4999);
shoe.shoeproperties(shoe.getbrand(), shoe.getsize(),shoe.getprice());
break;
}
break;
}
break;
}
switch (type.toLowerCase())
{
case "shorts":
System.out.println("Which Brand you want: ");
System.out.println("\nThe available brands are\nspykar\nuspolo\n");
String brand = in.next();
shorts.setbrand(brand);
switch (brand.toLowerCase())
{
case "spykar":
case"uspolo":
System.out.println("which size you want in cm: ");
System.out.println("\nThe available sizes are\nm\nl\nxl\n");
String sizes = in.next();
shorts.setsizes(sizes);
switch(sizes)
{
case "m" :
shorts.setprice(799);
shorts.shortproperties(shorts.getbrand(), shorts.getsizes(),shorts.getprice());
break;
case "l":
shorts.setprice(999);
shorts.shortproperties(shorts.getbrand(), shorts.getsizes(),shorts.getprice());
break;
case "xl":
shorts.setprice(1199);
shorts.shortproperties(shorts.getbrand(), shorts.getsizes(),shorts.getprice());
break;
}
break;
}
break;
}
switch (type.toLowerCase())
{
case "backpacks":
System.out.println("Which Brand you want: ");
System.out.println("\nThe available brands are\namerican tourister\nskybags");
String brand = in.next();
backpack.setbrand(brand);
switch (brand.toLowerCase())
{
case "americantourister":
case"skybags":
backpack.setprice(1599);
backpack.backpackproperties(backpack.getbrand(),backpack.getprice());
break;
}
break;
}
break;
case"womens":
System.out.println("what type of product do you want");
System.out.println("\nThe available products are\nsarees\nleggings\n");
String type1 = in.next();
switch (type1.toLowerCase())
{
case "sarees":
System.out.println("Which brand do you want: ");
System.out.println("\nThe available brands are\nchennaisilksarees\nkanchipuramsarees\n");
String brand = in.next();
saree.setbrand(brand);
switch (brand.toLowerCase())
{
case"chennaisilksarees":
case"kanchipuramsarees":
saree.setprice(15999);
saree.sareeproperties(saree.getbrand(),saree.getprice());
break;
}
}
switch (type1.toLowerCase())
{
case"leggings":
System.out.println("Which Brand you want: ");
System.out.println("\nThe available brands are\naurelia\ndrop\n");
String brand = in.next();
legging.setbrand(brand);
switch (brand.toLowerCase())
{
case "aurelia":
case"drop":
System.out.println("which size you want in cm: ");
System.out.println("\nThe available sizes are\nm\nl\nxl\n");
String sizes = in.next();
legging.setsizes(sizes);
switch(sizes)
{
case "m" :
legging.setprice(799);
legging.leggingproperties(legging.getbrand(), legging.getsizes(),legging.getprice());
break;
case "l":
legging.setprice(999);
legging.leggingproperties(legging.getbrand(), legging.getsizes(),legging.getprice());
break;
case "xl":
legging.setprice(1199);
legging.leggingproperties(legging.getbrand(), legging.getsizes(),legging.getprice());
break;
}
break;
}
break;
}
}
}
}