-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomeappliance.java
More file actions
642 lines (611 loc) · 24.5 KB
/
Homeappliance.java
File metadata and controls
642 lines (611 loc) · 24.5 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
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
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
import java.io.*;
class Homeappliance
{
static int choice=0,chphilips=0,chonida=0,chsamsung=0,chsony,zz=1,sum,gg,k,A=1,B,C=1,D=1;
String c,choic,chhh,vvv,cod,xx,vv;
String a[]=new String[100];
int b[]=new int[100];
int cb[]=new int[100];
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
public void run()throws IOException
{
System.out.println("##########___________############ ");
System.out.println("WELCOME TO MKKS HOME APPLIANCES ");
System.out.println("##########___________############ ");
System.out.println("WISH YOU NICE SHOPPING EXPERIANCE ");
System.out.println("WHAT WOULD LIKE TO BUY ??? ");
System.out.println("............................");
System.out.println("\n");
do
{
System.out.println("1.TELEVISION");
System.out.println("2.OVEN");
System.out.println("3.IF YOU WANT TO ADD OR REMOVE ANY PRODUCTS OR TO PRINT THE BILL PRESS 3");
System.out.println("ENTER THE CORRESPONDING NUMBER OF THE STORE YOU WANT TO TAKE A VISIT AND SHOP ");
int ch=Integer.parseInt(buf.readLine());
if(ch==1)
tv();
else
if(ch==2)
oven();
else
System.out.println("\n Type 'c' to continue buying or press any other key to exit from MAINSHOP \n");
c=buf.readLine();
if(c.equalsIgnoreCase("c"))
k=1;
else
break;
} while(c.equalsIgnoreCase("c"));
System.out.println("thanks for coming to our shop & we think you got things as your desire");
for(int ss=1;ss<=zz;ss++)
{
sum=sum+b[ss];
}
for(int i=0;i<2;i++);
System.out.println("##########............############ ");
System.out.println("\n Bill \n");
System.out.println("S.NO \t ITEM \t NO.OF ITEM \t COST ");
for(int pp=1;pp<=zz;pp++)
{
System.out.println(pp +"\t"+ a[pp] +"\t"+ cb[pp] +"\t"+ b[pp] );
}
System.out.println("\n");
System.out.println("TOTAL "+sum);
O: do
{
System.out.println("\n IF YOU WANT TO REMOVE ANY ITEM FROM THE CHART PRESS 'Y' OTHERWISE PRESS ANY OTHER KEY \n");
xx=buf.readLine();
if(xx.equalsIgnoreCase("y"))
{
gg=0;
System.out.println("SELECT ANY S.NO FROM THE CHART FOR WHICH ITEM YOU WANT TO REMOVE ");
gg=Integer.parseInt(buf.readLine());
sum=0;
for(int ss=1;ss<=zz;ss++)
{
if(ss!=gg)
sum=sum=b[ss];
}
System.out.println("\n Bill \n");
System.out.println("S.NO \t ITEM \t NO.OF ITEM \t COST ");
int sss=1;
for(int pp=1;pp<=zz;pp++)
{
if(pp!=gg)
{
a[sss]=a[pp];
cb[sss]=cb[pp];
b[sss]=b[pp];
System.out.println(sss +"\t"+a[pp]+ "\t"+ cb[pp] +"\t" +b[pp] );
sss++;
}
}
System.out.println("\n \n");
System.out.println("==================================================");
System.out.println("TOTAL "+sum);
zz=zz-1;
}
else
break O;
}while(xx.equalsIgnoreCase("y"));
System.out.println(" THANK YOU FOR VISITING OUR SHOP HAVE A NICE DAY ");
System.out.println(" VISIT OUR SHOP AGAIN............................ ");
System.out.println("**************************************************");
System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
}
//closing input
public void tv()throws IOException
{
do
{
System.out.println(" ############################################ " );
System.out.println(" CHECK OUT THE NEW PRODUCTS OF TV " );
System.out.println(" " );
System.out.println(" WHICH WOULD YOU LIKE TO BUY ");
System.out.println(" =========================== " );
System.out.println(" PRODUCTS AVAILABLE IN TV ARE .................. " );
System.out.println(" 1.ONIDA " );
System.out.println(" 2.SAMSUNG" );
System.out.println(" 3.PHILIPS " );
System.out.println(" " );
System.out.println(" ENTER YOUR CHOICE " );
choice=Integer.parseInt(buf.readLine());
switch(choice)
{
case 1:
do
{
onida();
{
System.out.println(" \n Type ‘c’ TO CONTINUE SHOPPING IN OR PRESS ANY KEY TO EXIT FROM ONIDA" );
vvv=buf.readLine();
}
} while(vvv.equalsIgnoreCase("c"));
break;
case 2:
do
{
samsung();
{
System.out.println(" \n Type ‘c’ TO CONTINUE SHOPPING IN OR PRESS ANY KEY TO EXIT FROM SAMSUNG" );
vvv=buf.readLine();
}
} while(vvv.equalsIgnoreCase("c"));
break;
case 3:
do
{
philips();
{
System.out.println(" \n Type ‘c’ TO CONTINUE SHOPPING IN OR PRESS ANY KEY TO EXIT FROM PHILIPS " );
vvv=buf.readLine();
}
} while(vvv.equalsIgnoreCase("c"));
break;
default:
System.out.println("INVALID CHOICE.................");
}
System.out.println(" \n Type ‘c’ TO CONTINUE SHOPPING IN OR PRESS ANY KEY TO EXIT FROM TV " );
vvv=buf.readLine();
if(vvv.equalsIgnoreCase("c"))
tv();
else
run();
} while(vvv.equalsIgnoreCase("c"));
}
public void onida()throws IOException
{
System.out.println("PRODUCTS AVAILABLE IN ONIDA ARE........................ ");
System.out.println(" ");
System.out.println("1.ONIDA CHROME ");
System.out.println("2.ONIDA CHROMED ");
System.out.println("3.ONIDA LEO24HRB LED ");
System.out.println(" ");
System.out.println("........ ENTER YOUR CHOICE........");
chonida=Integer.parseInt(buf.readLine());
B=1;
switch(chonida)
{
case 1:
B=1;
System.out.println(" ");
System.out.println("ONIDA CHROME ");
System.out.println("50 Inch");
System.out.println("LED TV ");
System.out.println("FULL HD");
System.out.println("COST =RS : 50000 ");
System.out.println("Would you like to buy");
System.out.println("Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println("Thank you for buying " );
a[B]= "ONIDA CHROME";
b[zz]=49999;
cb[zz]=A;
A++;
}
break;
case 2:
B=2;
System.out.println(" ");
System.out.println("ONIDA CHROMED ");
System.out.println("32 INCH");
System.out.println("LCD TV");
System.out.println(" USB CONNECTIVITY");
System.out.println("COST =RS : 29990");
System.out.println("Would you like to buy");
System.out.println("Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println("Thank you for buying " );
a[B]= "ONIDA CHROMED";
b[zz]=29999;
cb[++zz]=C;
C++;
}
break;
case 3:
B=3;
System.out.println(" ");
System.out.println("KLV40BX400 ");
System.out.println("BRAVIA LED TV ");
System.out.println("40 Inch");
System.out.println("FULL HD");
System.out.println("COST =RS: 42000 ");
System.out.println("Would you like to buy");
System.out.println("Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println("Thank you for buying " );
a[B]= "KLV40BX400";
b[zz]=42000;
cb[++zz]=D;
D++;
}
break;
}
}
public void samsung()throws IOException
{
System.out.println("PRODUCTS AVAILABLE IN SAMSUNG ARE........................ ");
System.out.println(" ");
System.out.println("1.SAMSUNG46EH4003");
System.out.println("2.SAMSUNG43EH4254");
System.out.println("3.SAMSUNG40EH4025");
System.out.println(" ");
System.out.println("ENTER YOUR CHOICE");
chsamsung=Integer.parseInt(buf.readLine());
switch(chsamsung)
{
case 1:
System.out.println(" ");
System.out.println("SAMSUNG46EH4003 ");
System.out.println("46INCH ");
System.out.println("LED TV");
System.out.println("PLASMA PLANEL");
System.out.println("COST =RS : 85360 ");
System.out.println("Would you like to buy");
System.out.println("Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println("Thank you for buying " );
a[++zz]= "SAMSUNG46EH4003";
b[++zz]=85360;
cb[++zz]++;
}
break;
case 2:
System.out.println(" ");
System.out.println("SAMSUNG43EH4254 ");
System.out.println("43INCH ");
System.out.println("LED TV");
System.out.println("PLASMA PLANEL");
System.out.println("COST =RS : 33380 ");
System.out.println("Would you like to buy");
System.out.println("Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println("Thank you for buying " );
a[++zz]= "SAMSUNG43EH4254";
b[++zz]=33389;
cb[++zz]++;
}
break;
case 3:
System.out.println(" ");
System.out.println("SAMSUNG40EH4025 ");
System.out.println("40INCH ");
System.out.println("LED TV");
System.out.println("CONNECTIVITIES AVAILABLE");
System.out.println("COST =RS : 48750 ");
System.out.println("Would you like to buy");
System.out.println("Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println("Thank you for buying " );
a[++zz]= "SAMSUNG40EH4025";
b[++zz]=48750;
cb[++zz]++;
}
break;
default:
System.out.println("INVALID CHOICE.............. " );
}
}
public void philips()throws IOException
{
System.out.println("PRODUCTS AVAILABLE IN PHILIPS ARE........................ ");
System.out.println(" ");
System.out.println("1.KDL50W829");
System.out.println("2.KLV40BX400");
System.out.println("3.KLV26BX300");
System.out.println(" ");
System.out.println("........ ENTER YOUR CHOICE........");
chphilips=Integer.parseInt(buf.readLine());
switch(chphilips)
{
case 1:
System.out.println(" ");
System.out.println("KDL50W829 ");
System.out.println("50 Inch");
System.out.println("screen type flat ");
System.out.println("3D led Tv full HD");
System.out.println("COST =RS : 50000 ");
System.out.println("Would you like to buy");
System.out.println("Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println("Thank you for buying " );
a[++zz]= "KDL50W829";
b[++zz]=50000;
cb[++zz]++;
}
break;
case 2:
System.out.println(" ");
System.out.println("KLV40BX400 ");
System.out.println("BRAVIA LED TV ");
System.out.println("40 Inch");
System.out.println("full HD");
System.out.println("COST =RS : 42000 ");
System.out.println("Would you like to buy");
System.out.println("Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println("Thank you for buying " );
a[++zz]= "KLV40BX400";
b[++zz]=42000;
cb[++zz]++;
}
break;
case 3:
System.out.println(" ");
System.out.println("KLV26BX300 ");
System.out.println("26 Inch");
System.out.println("BRAVIA LED TV ");
System.out.println("HD");
System.out.println("COST =RS : 25000 ");
System.out.println("Would you like to buy");
System.out.println("Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println("Thank you for buying " );
a[++zz]= "KLV26BX300";
b[++zz]=25000;
cb[++zz]++;
}
break;
default:
System.out.println("INVALID CHOICE..................... ");
}
}
public void oven()throws IOException
{
do
{
System.out.println(" ############################################ " );
System.out.println(" CHECK OUT THE NEW PRODUCTS OF OVEN " );
System.out.println(" " );
System.out.println(" WHICH WOULD YOU LIKE TO BUY ");
System.out.println(" =========================== " );
System.out.println(" PRODUCTS AVAILABLE IN OVEN ARE .................. " );
System.out.println(" 1.ONIDA " );
System.out.println(" 2.SAMSUNG" );
System.out.println(" 3.PHILIP " );
System.out.println(" " );
System.out.println(" ENTER YOUR CHOICE " );
choice=Integer.parseInt(buf.readLine());
switch(choice)
{
case 1:
do
{
onida();
{
System.out.println(" \n Type ‘c’ TO CONTINUE SHOPPING IN OR PRESS ANY KEY TO EXIT FROM ONIDA " );
vvv=buf.readLine();
}
} while(vvv.equalsIgnoreCase("c"));
break;
case 2:
do
{
samsungo();
{
System.out.println(" \n Type ‘c’ TO CONTINUE SHOPPING IN OR PRESS ANY KEY TO EXIT FROM SAMSUNG " );
vvv=buf.readLine();
}
} while(vvv.equalsIgnoreCase("c"));
break;
case 3:
do
{
philips();
{
System.out.println(" \n Type ‘c’ TO CONTINUE SHOPPING IN OR PRESS ANY KEY TO EXIT FROM PHILIPS " );
vvv=buf.readLine();
}
} while(vvv.equalsIgnoreCase("c"));
break;
}
System.out.println(" \n Type ‘c’ TO CONTINUE SHOPPING IN OR PRESS ANY KEY TO EXIT FROM OVEN " );
vvv=buf.readLine();
if(vvv.equalsIgnoreCase("c"))
oven();
else
run();
} while(vvv.equalsIgnoreCase("c"));
}
public void onidao()throws IOException
{
System.out.println(" OPTIONS AVAILABLE IN ONIDA OVENS ARE....................... ");
System.out.println(" ");
System.out.println(" 1.BLACK BEAUTY PB 28");
System.out.println(" 2.CLASSIC PC 23");
System.out.println(" 3.DIAMOND PC 23");
System.out.println(" ");
System.out.println(" ENTER YOUR CHOICE ");
chsony=Integer.parseInt(buf.readLine());
switch(chsony)
{
case 1:
System.out.println(" ");
System.out.println(" BLACK BEAUTY PB 28 ");
System.out.println(" COST =RS :13000");
System.out.println(" Would you like to buy ");
System.out.println(" Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println(" Thank you for buying ");
a[++zz]="BLACK BEAUTY PB 28";
b[++zz]=13999;
cb[++zz]++;
break;
}
case 2:
System.out.println(" ");
System.out.println(" CLASSIC PC 23 ");
System.out.println(" COST =RS : 10000");
System.out.println(" Would you like to buy ");
System.out.println(" Enter your choicey/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println(" Thank you for buying ");
a[++zz]="CLASSIC PC 23";
b[++zz]=10000;
cb[++zz]++;
break;
}
case 3:
System.out.println(" ");
System.out.println(" DIAMOND PC 23 ");
System.out.println(" COST =RS : 14500");
System.out.println(" Would you like to buy ");
System.out.println(" Enter your choicey/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println(" Thank you for buying ");
a[++zz]="DIAMOND PC 23";
b[++zz]=14500;
cb[++zz]++;
break;
}
default:
System.out.println("invalid case");
}
}
public void samsungo()throws IOException
{
System.out.println(" OPTIONS AVAILABE IN SAMSUNG OVENS ARE...................... ");
System.out.println(" ");
System.out.println(" 1.GRILL GW732KD");
System.out.println(" 2.ifP20SC2");
System.out.println(" 3.CONVENTION GET4JDCR");
System.out.println(" ");
System.out.println(" ENTER YOUR CHOICE ");
chsony=Integer.parseInt(buf.readLine());
switch(chsony)
{
case 1:
System.out.println(" ");
System.out.println("GRILL GW732KD");
System.out.println(" COST =RS : 6580");
System.out.println(" Would you like to buy ");
System.out.println(" Enter your choicey/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println(" Thank you for buying ");
a[++zz]=" GRILL GW732KD";
b[++zz]=6580;
cb[++zz]++;
break;
}
case 2:
System.out.println(" ");
System.out.println(" ifP20SC2");
System.out.println(" COST =RS : 8460");
System.out.println(" Would you like to buy ");
System.out.println(" Enter your choicey/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println(" Thank you for buying ");
a[++zz]=" ifP20SC2";
b[++zz]=8460;
cb[++zz]++;
break;
}
case 3:
System.out.println(" ");
System.out.println(" CONVENTION GET4JDCR");
System.out.println(" COST =RS : 10250");
System.out.println(" Would you like to buy ");
System.out.println(" Enter your choicey/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println(" Thank you for buying ");
a[++zz]=" CONVENTION GET4JDCR";
b[++zz]=10250;
cb[++zz]++;
}
break;
default:
System.out.println("INVALID CHOICE");
}
}
public void philipsO()throws IOException
{
System.out.println(" OPTIONS AVAILABLE IN PHILIPS OVENS ARE....................... ");
System.out.println(" ");
System.out.println(" 1.CONVENTION MC2143CD21L");
System.out.println(" 2.POWER GRILL MS2021CN");
System.out.println(" 3.GRILL MH2043DW");
System.out.println(" ");
System.out.println(" ENTER YOUR CHOICE ");
chphilips=Integer.parseInt(buf.readLine());
switch(chphilips)
{
case 1:
System.out.println(" ");
System.out.println(" CONVENTION MC2143CD21L");
System.out.println(" COST =RS : 9750");
System.out.println(" Would you like to buy ");
System.out.println(" Enter your choice y/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println(" Thank you for buying ");
a[++zz]=" CONVENTION MC2143CD21L";
b[++zz]=9750;
cb[++zz]++;
}
break;
case 2:
System.out.println(" ");
System.out.println(" POWER GRILL MS2021CN");
System.out.println(" COST =RS : 5050");
System.out.println(" Would you like to buy ");
System.out.println(" Enter your choicey/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println(" Thank you for buying ");
a[++zz]=" POWER GRILL MS2021CN";
b[++zz]=5025;
cb[++zz]++;
}
break;
case 3:
System.out.println(" ");
System.out.println(" GRILL MH2043DW");
System.out.println(" COST =RS : 7000");
System.out.println(" Would you like to buy ");
System.out.println(" Enter your choicey/n ");
cod=buf.readLine();
if(cod.equalsIgnoreCase("y"))
{
System.out.println(" Thank you for buying ");
a[++zz]=" GRILL MH2043DW";
b[++zz]=7060;
cb[++zz]++;
}
break;
default:
System.out.println("invalid case");
}
}
}