forked from ahmadazizfauzi/Kasir_sederhana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkasirnew3.cpp
727 lines (612 loc) · 45.9 KB
/
kasirnew3.cpp
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
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
#include <iostream>
using namespace std;
//nyobo zizzzzzz
void petunjuk() {
cout << "===================================================================================================================================================" << endl;
cout << " SELAMAT DATANG DI MENU PETUNJUK" << endl;
cout << "===================================================================================================================================================" << endl<< endl;
cout << " Petunjuk " << endl;
cout << "1. Pilih menu untuk membeli barang, melihat total harga, membayar, ataupun keluar dari toko" << endl;
cout << "2. Pastikan jangan salah saat menginput jawaban, karena sistem akan mengulang/menjadi error saat ada kesalahan " << endl;
cout << "3. Pastikan anda sudah menyediakan uang untuk membayar total tagihan yang Anda beli !, karena toko tidak menerima hutang" << endl;
cout << "4. Semua percobaan pencurian dan sejenisnya akan terpantau oleh sistem, sehingga toko akan melaporkan kepada pihak berwajib jika ada tindak kriminal " << endl;
cout << "5. Jika terjadi kesalahan atau ada hal-hal yang ingin ditanyakan, silahkan hubungi customer service di nomor 085216373763" << endl << endl;
cout << "===================================================================================================================================================" << endl;
cout << " Tentang diskon" << endl;
cout << "===================================================================================================================================================" << endl;
cout << "1. Anda mendapatkan diskon sebesar 2,5%, jika nominal total produk adalah diatas Rp. 10.000.000 " << endl;
cout << "2. Anda mendapatkan diskon sebesar 5%, jika nominal total produk adalah diatas Rp. 20.000.000 " << endl;
cout << "3. Anda mendapatkan diskon sebesar 10%, jika nominal total produk adalah diatas Rp. 50.000.000 " << endl;
cout << "=====================================================================================================================================================" << endl;
cout << " TERIMA KASIH" << endl;
cout << "=====================================================================================================================================================" << endl;
}
void puas_tidakpuas() {
cout << "Silahkan pilih di antara 5 pilihan di bawah ini dengan jujur" << endl;
cout << "1. Sangat puas " << endl;
cout << "2. Puas " << endl;
cout << "3. Biasa aja " << endl;
cout << "4. Tidak puas " << endl;
cout << "5. Sangat tidak puas " << endl;
cout << "Silahkan pilih nomor 1-5 berdasarkan perasaan Anda : ";
}
int main () {
string beli1, beli2;
string ans;
// INTEGER I
int i=0;
// MENGHITUNG TRANSAKSI
int harga[1000];
int totaltagihansd = 0;
int totaltagihandd = 0;
int brp[1000];
int menu;
// DISKON
float diskon;
int tampildiskon;
string brpdiskon;
// PEMBELIAN ...
// LAPTOP
int brplaptopacer = 0;
int hargalaptopacer = 0;
int brplaptopasus = 0;
int hargalaptopasus = 0;
int brplaptoplenovo = 0;
int hargalaptoplenovo = 0;
// MODEM
int brpmodemtelkom = 0;
int hargamodemtelkom = 0;
int brpmodemxl = 0;
int hargamodemxl = 0;
int brpmodemsf = 0;
int hargamodemsf = 0;
// JOYSTICK
int brpjoysticksony = 0;
int hargajoysticksony = 0;
int brpjoystickalpha = 0;
int hargajoystickalpha = 0;
int brpjoystickmegapro = 0;
int hargajoystickmegapro = 0;
// MENU 3 (PEMBAYARAN)
int bayar;
int susuk;
int kurang;
// SURVEY
string saran;
string survey;
string puas;
string nama;
int umur;
string alamat;
string email;
do {
system("cls");
cout << "================================================================================================================================================" << endl;
cout << " SELAMAT DATANG DI TOKO MODERN RATURU " << endl;
cout << "================================================================================================================================================" << endl;
cout << " " ; system("pause");
system("cls");
cout << " ==============================================" << endl;
cout << " KERANJANG " << endl;
cout << " ==============================================" << endl;
cout << " Item | Jumlah | Harga " << endl;
if(brplaptopacer > 0) {
cout <<" Laptop ACER " << brplaptopacer << " " << "Rp." << hargalaptopacer << endl;
}
if(brplaptopasus > 0) {
cout <<" Laptop ASUS " << brplaptopasus << " " << "Rp." << hargalaptopasus << endl;
}
if (brplaptoplenovo > 0) {
cout <<" Laptop LENOVO " << brplaptoplenovo<< " " << "Rp." << hargalaptoplenovo << endl;
}
if(brpmodemtelkom > 0) {
cout <<" Modem TELKOM " << brpmodemtelkom << " " << "Rp." << hargamodemtelkom << endl;
}
if(brpmodemxl > 0) {
cout <<" Modem XL " << brpmodemxl << " " << "Rp." << hargamodemxl << endl;
}
if(brpmodemsf > 0) {
cout <<" Modem SMARTFREN " << brpmodemsf << " " << "Rp." << hargamodemsf << endl;
}
if(brpjoysticksony > 0) {
cout <<" Joystick SONY " << brpjoysticksony << " " << "Rp." << hargajoysticksony << endl;
}
if(brpjoystickalpha > 0) {
cout <<" Joystick ALPHA " << brpjoystickalpha <<" " << "Rp." << hargajoystickalpha << endl;
}
if(brpjoystickmegapro > 0) {
cout <<" Joystick MEGAPRO " << brpjoystickmegapro <<" " << "Rp." << hargajoystickmegapro << endl;
}
cout << " Total tagihan pembelian sebelum diskon = Rp." << totaltagihansd << endl;
cout << "1. Beli item " << endl;
cout << "2. Bayar " << endl;
cout << "3. Petunjuk " << endl;
cout << "4. exit" << endl;
cout << "Silahkan pilih nomor menu yang Anda inginkan "<< endl;
cin >> menu;
while(menu > 5) {
cout << " ==============================================" << endl;
cout << " KERANJANG " << endl;
cout << " ==============================================" << endl; cout << " Item | Jumlah | Harga " << endl;
if(brplaptopacer > 0) {
cout <<" Laptop ACER " << brplaptopacer << " " << "Rp." << hargalaptopacer << endl;
}
if(brplaptopasus > 0) {
cout <<" Laptop ASUS " << brplaptopasus << " " << "Rp." << hargalaptopasus << endl;
}
if (brplaptoplenovo > 0) {
cout <<" Laptop LENOVO " << brplaptoplenovo<< " " << "Rp." << hargalaptoplenovo << endl;
}
if(brpmodemtelkom > 0) {
cout <<" Modem TELKOM " << brpmodemtelkom << " " << "Rp." << hargamodemtelkom << endl;
}
if(brpmodemxl > 0) {
cout <<" Modem XL " << brpmodemxl << " " << "Rp." << hargamodemxl << endl;
}
if(brpmodemsf > 0) {
cout <<" Modem SMARTFREN " << brpmodemsf << " " << "Rp." << hargamodemsf << endl;
}
if(brpjoysticksony > 0) {
cout <<" Joystick SONY " << brpjoysticksony << " " << "Rp." << hargajoysticksony << endl;
}
if(brpjoystickalpha > 0) {
cout <<" Joystick ALPHA " << brpjoystickalpha <<" " << "Rp." << hargajoystickalpha << endl;
}
if(brpjoystickmegapro > 0) {
cout <<" Joystick MEGAPRO " << brpjoystickmegapro <<" " << "Rp." << hargajoystickmegapro << endl;
}
cout << " Total tagihan pembelian sebelum diskon = Rp." << totaltagihansd << endl;
cout << "Pilih menu antara 1-5 saja" << endl;
cout << "1. Beli item " << endl;
cout << "2. Bayar " << endl;
cout << "3. Petunjuk " << endl;
cout << "4. exit" << endl;
cout << "Silahkan pilih nomor menu yang Anda inginkan "<< endl;
cin >> menu;
}
if (menu == 1) {
system("cls");
cout << " ==============================================" << endl;
cout << " KERANJANG " << endl;
cout << " ==============================================" << endl; cout << " Item | Jumlah | Harga " << endl;
if(brplaptopacer > 0) {
cout <<" Laptop ACER " << brplaptopacer << " " << "Rp." << hargalaptopacer << endl;
}
if(brplaptopasus > 0) {
cout <<" Laptop ASUS " << brplaptopasus << " " << "Rp." << hargalaptopasus << endl;
}
if (brplaptoplenovo > 0) {
cout <<" Laptop LENOVO " << brplaptoplenovo<< " " << "Rp." << hargalaptoplenovo << endl;
}
if(brpmodemtelkom > 0) {
cout <<" Modem TELKOM " << brpmodemtelkom << " " << "Rp." << hargamodemtelkom << endl;
}
if(brpmodemxl > 0) {
cout <<" Modem XL " << brpmodemxl << " " << "Rp." << hargamodemxl << endl;
}
if(brpmodemsf > 0) {
cout <<" Modem SMARTFREN " << brpmodemsf << " " << "Rp." << hargamodemsf << endl;
}
if(brpjoysticksony > 0) {
cout <<" Joystick SONY " << brpjoysticksony << " " << "Rp." << hargajoysticksony << endl;
}
if(brpjoystickalpha > 0) {
cout <<" Joystick ALPHA " << brpjoystickalpha <<" " << "Rp." << hargajoystickalpha << endl;
}
if(brpjoystickmegapro > 0) {
cout <<" Joystick MEGAPRO " << brpjoystickmegapro <<" " << "Rp." << hargajoystickmegapro << endl;
}
cout << " Total tagihan pembelian sebelum diskon = Rp." << totaltagihansd << endl;
cout << "Silahkan memilih salah satu item yang ingin Anda beli di bawah ini " << endl;
cout << "1. Laptop " << endl;
cout << "2. Modem " << endl;
cout << "3. Joystick " << endl;
cout << "Pilih menu " << endl;
cin >> beli1;
if(beli1 == "1") {
system("cls");
cout << " ==============================================" << endl;
cout << " KERANJANG " << endl;
cout << " ==============================================" << endl;cout << " Item | Jumlah | Harga " << endl;
if(brplaptopacer > 0) {
cout <<" Laptop ACER " << brplaptopacer << " " << "Rp." << hargalaptopacer << endl;
}
if(brplaptopasus > 0) {
cout <<" Laptop ASUS " << brplaptopasus << " " << "Rp." << hargalaptopasus << endl;
}
if (brplaptoplenovo > 0) {
cout <<" Laptop LENOVO " << brplaptoplenovo<< " " << "Rp." << hargalaptoplenovo << endl;
}
if(brpmodemtelkom > 0) {
cout <<" Modem TELKOM " << brpmodemtelkom << " " << "Rp." << hargamodemtelkom << endl;
}
if(brpmodemxl > 0) {
cout <<" Modem XL " << brpmodemxl << " " << "Rp." << hargamodemxl << endl;
}
if(brpmodemsf > 0) {
cout <<" Modem SMARTFREN " << brpmodemsf << " " << "Rp." << hargamodemsf << endl;
}
if(brpjoysticksony > 0) {
cout <<" Joystick SONY " << brpjoysticksony << " " << "Rp." << hargajoysticksony << endl;
}
if(brpjoystickalpha > 0) {
cout <<" Joystick ALPHA " << brpjoystickalpha <<" " << "Rp." << hargajoystickalpha << endl;
}
if(brpjoystickmegapro > 0) {
cout <<" Joystick MEGAPRO " << brpjoystickmegapro <<" " << "Rp." << hargajoystickmegapro << endl;
}
cout << " Total tagihan pembelian sebelum diskon = Rp." << totaltagihansd << endl;
cout << "Anda memilih menu laptop " << endl;
cout << "Silahkan pilih merk laptop di bawah " << endl;
cout << "1. Laptop acer = Rp.15.000.000 " << endl;
cout << "2. Laptop asus = Rp.12.000.000" << endl;
cout << "3. Laptop lenovo = Rp.10.000.000" << endl;
cout << "Pilih nomor menu : ";
cin >> beli2;
if(beli2 == "1") {
cout << "Anda memilih laptop ACER " << endl;
cout << "berapa laptop ACER yang ingin Anda beli : ";
cin >> brp[i];
harga[i] = brp[i] * 15000000;
brplaptopacer += brp[i];
hargalaptopacer += harga[i];
totaltagihansd += harga[i];
} else if(beli2 == "2") {
cout << "Anda memilih laptop ASUS " << endl;
cout << "berapa laptop acer yang ingin Anda beli : ";
cin >> brp[i];
harga[i] = brp[i] * 12000000;
brplaptopasus += brp[i];
hargalaptopasus += harga[i];
totaltagihansd += harga[i];
} else if(beli2 == "3") {
cout << "Anda memilih laptop LENOVO " << endl;
cout << "berapa laptop LENOVO yang ingin Anda beli : ";
cin >> brp[i];
harga[i] = brp[i] * 10000000;
brplaptoplenovo += brp[i];
hargalaptoplenovo += harga[i];
totaltagihansd += harga[i];
}
}
else if(beli1 == "2"){
system("cls");
cout << " ==============================================" << endl;
cout << " KERANJANG " << endl;
cout << " ==============================================" << endl;cout << " Item | Jumlah | Harga " << endl;
if(brplaptopacer > 0) {
cout <<" Laptop ACER " << brplaptopacer << " " << "Rp." << hargalaptopacer << endl;
}
if(brplaptopasus > 0) {
cout <<" Laptop ASUS " << brplaptopasus << " " << "Rp." << hargalaptopasus << endl;
}
if (brplaptoplenovo > 0) {
cout <<" Laptop LENOVO " << brplaptoplenovo<< " " << "Rp." << hargalaptoplenovo << endl;
}
if(brpmodemtelkom > 0) {
cout <<" Modem TELKOM " << brpmodemtelkom << " " << "Rp." << hargamodemtelkom << endl;
}
if(brpmodemxl > 0) {
cout <<" Modem XL " << brpmodemxl << " " << "Rp." << hargamodemxl << endl;
}
if(brpmodemsf > 0) {
cout <<" Modem SMARTFREN " << brpmodemsf << " " << "Rp." << hargamodemsf << endl;
}
if(brpjoysticksony > 0) {
cout <<" Joystick SONY " << brpjoysticksony << " " << "Rp." << hargajoysticksony << endl;
}
if(brpjoystickalpha > 0) {
cout <<" Joystick ALPHA " << brpjoystickalpha <<" " << "Rp." << hargajoystickalpha << endl;
}
if(brpjoystickmegapro > 0) {
cout <<" Joystick MEGAPRO " << brpjoystickmegapro <<" " << "Rp." << hargajoystickmegapro << endl;
}
cout << " Total tagihan pembelian sebelum diskon = Rp." << totaltagihansd << endl;
cout << "Anda memilih menu modem " << endl;
cout << "Silahkan memilih merek modem di bawah ini " << endl;
cout << "1. Modem telkom = Rp.300.000 " << endl;
cout << "2. Modem xl = Rp.250.000 " << endl;
cout << "3. Modem Smartfren = Rp.200.000 " << endl;
cout << "Pilih nomor menu : ";
cin >> beli2;
if(beli2 == "1") {
cout << "Anda memilih modem TELKOM " << endl;
cout << "Berapa modem TELKOM yang ingin Anda beli : ";
cin >> brp[i];
harga[i] = brp[i] * 300000;
brpmodemtelkom += brp[i];
hargamodemtelkom += harga[i];
totaltagihansd += harga[i];
} else if(beli2 == "2") {
cout << "Anda memilih modem XL " << endl;
cout << "Berapa modem XL yang ingin Anda beli : ";
cin >> brp[i];
harga[i] = brp[i] * 250000;
brpmodemxl += brp[i];
hargamodemxl += harga[i];
totaltagihansd += harga[i];
} else if(beli2 == "3") {
cout << "Anda memilih modem SMARTFREN " << endl;
cout << "Berapa modem SMARTFREN yang ingin Anda beli : ";
cin >> brp[i];
harga[i] = brp[i] * 200000;
brpmodemsf += brp[i];
hargamodemsf += harga[i];
totaltagihansd += harga[i];
}
}
else if(beli1 == "3") {
system("cls");
cout << " ==============================================" << endl;
cout << " KERANJANG " << endl;
cout << " ==============================================" << endl;cout << " Item | Jumlah | Harga " << endl;
if(brplaptopacer > 0) {
cout <<" Laptop ACER " << brplaptopacer << " " << "Rp." << hargalaptopacer << endl;
}
if(brplaptopasus > 0) {
cout <<" Laptop ASUS " << brplaptopasus << " " << "Rp." << hargalaptopasus << endl;
}
if (brplaptoplenovo > 0) {
cout <<" Laptop LENOVO " << brplaptoplenovo<< " " << "Rp." << hargalaptoplenovo << endl;
}
if(brpmodemtelkom > 0) {
cout <<" Modem TELKOM " << brpmodemtelkom << " " << "Rp." << hargamodemtelkom << endl;
}
if(brpmodemxl > 0) {
cout <<" Modem XL " << brpmodemxl << " " << "Rp." << hargamodemxl << endl;
}
if(brpmodemsf > 0) {
cout <<" Modem SMARTFREN " << brpmodemsf << " " << "Rp." << hargamodemsf << endl;
}
if(brpjoysticksony > 0) {
cout <<" Joystick SONY " << brpjoysticksony << " " << "Rp." << hargajoysticksony << endl;
}
if(brpjoystickalpha > 0) {
cout <<" Joystick ALPHA " << brpjoystickalpha <<" " << "Rp." << hargajoystickalpha << endl;
}
if(brpjoystickmegapro > 0) {
cout <<" Joystick MEGAPRO " << brpjoystickmegapro <<" " << "Rp." << hargajoystickmegapro << endl;
}
cout << " Total tagihan pembelian sebelum diskon = Rp." << totaltagihansd << endl;
cout << "Silahkan memilih merek joystick di bawah ini " << endl;
cout << "1. Joystick SONY = Rp.125.000" << endl;
cout << "2. Joystick ALPHA = Rp.150.000" << endl;
cout << "3. Joystick MEGAPRO = Rp.175.000" << endl;
cout << "Pilih nomor : ";
cin >> beli2;
if(beli2 == "1") {
cout << "Anda memilih joystick SONY " << endl;
cout << "Berapa joystick SONY yang ingin Anda beli : ";
cin >> brp[i];
harga[i] = brp[i] * 125000;
brpjoysticksony += brp[i];
hargajoysticksony += harga[i];
totaltagihansd += harga[i];
} else if(beli2 == "2") {
cout << "Anda memilih joystick ALPHA " << endl;
cout << "Berapa joystick ALPHA yang ingin Anda beli : ";
cin >> brp[i];
harga[i] = brp[i] * 150000;
brpjoystickalpha += brp[i];
hargajoystickalpha += harga[i];
totaltagihansd += harga[i];
} else if(beli2 == "3") {
cout << "Anda memilih joystick MEGAPRO " << endl;
cout << "Berapa joystick MEGAPRO yang ingin Anda beli : ";
cin >> brp[i];
harga[i] = brp[i] * 175000;
brpjoystickmegapro += brp[i];
hargajoystickmegapro += harga[i];
totaltagihansd += harga[i];
}
}
}
else if(menu == 2) {
system("cls");
// MENGHITUNG TAGIHAN PER ITEM
cout << "================================================================= " << endl;
cout << " STRUK PEMBAYARAN " << endl;
cout << "=================================================================" << endl << endl;
cout << "Item | Jumlah | Harga " << endl;
if(brplaptopacer > 0) {
cout <<"Laptop ACER " << brplaptopacer << " " << "Rp." << hargalaptopacer << endl;
}
if(brplaptopasus > 0) {
cout <<"Laptop ASUS " << brplaptopasus << " " << "Rp." << hargalaptopasus << endl;
}
if (brplaptoplenovo > 0) {
cout <<"Laptop LENOVO " << brplaptoplenovo<< " " << "Rp." << hargalaptoplenovo << endl;
}
if(brpmodemtelkom > 0) {
cout <<"Modem TELKOM " << brpmodemtelkom << " " << "Rp." << hargamodemtelkom << endl;
}
if(brpmodemxl > 0) {
cout <<"Modem XL " << brpmodemxl << " " << "Rp." << hargamodemxl << endl;
}
if(brpmodemsf > 0) {
cout <<"Modem SMARTFREN " << brpmodemsf << " " << "Rp." << hargamodemsf << endl;
}
if(brpjoysticksony > 0) {
cout <<"Joystick SONY " << brpjoysticksony << " " << "Rp." << hargajoysticksony << endl;
}
if(brpjoystickalpha > 0) {
cout <<"Joystick ALPHA " << brpjoystickalpha <<" " << "Rp." << hargajoystickalpha << endl;
}
if(brpjoystickmegapro > 0) {
cout <<"Joystick MEGAPRO " << brpjoystickmegapro <<" " << "Rp." << hargajoystickmegapro << endl;
}
// MENGOUTPUT TOTAL SELURUH TAGIHAN
if(totaltagihansd >= 10000000 && totaltagihansd < 20000000) {
brpdiskon = "2,5%";
diskon = 0.025;
diskon = diskon * totaltagihansd;
tampildiskon = diskon;
totaltagihandd = totaltagihansd - (diskon);
}
else if(totaltagihansd >= 20000000 && totaltagihansd < 50000000) {
brpdiskon = "5%";
diskon = 0.05;
diskon = totaltagihansd * diskon;
tampildiskon = diskon;
totaltagihandd = totaltagihansd - diskon;
}
else if(totaltagihansd >= 50000000) {
brpdiskon = "10%";
diskon = 0.1;
diskon = totaltagihansd * diskon;
tampildiskon = diskon;
totaltagihandd = totaltagihansd - diskon;
}
cout << "Total tagihan pembelian sebelum diskon = Rp." << totaltagihansd << endl;
cout << "Total diskon = Rp." << brpdiskon << endl;
cout << "Nominal diskon = Rp." << tampildiskon << endl;
cout << "Total tagihan pembelian diskon yang harus dibayarkan = Rp." << totaltagihandd << endl;
cout << "Silahkan bayar tagihan Anda : Rp.";
cin >> bayar;
if(bayar > totaltagihandd) {
susuk = bayar - totaltagihandd;
cout << "Anda membayar sejumlah = Rp." << bayar << endl;
cout << "Kembalian anda adalah = Rp." << susuk << endl;
}
else if(bayar == totaltagihandd) {
cout << "Anda membayar sejumlah = Rp." << bayar << endl;
cout << "Tidak ada kembalian untuk Anda ";
}
while(bayar < totaltagihandd) {
kurang = totaltagihandd - bayar;
cout << "Anda membayar sejumlah = Rp." << bayar << endl;
cout << "Total tagihan adalah = Rp." << totaltagihandd << endl;
cout << "Uang anda kurang = Rp." << kurang << endl;
cout << "Silahkan tambah pembayaran dengan kekurangan : Rp.";
cin >> kurang;
bayar = bayar + kurang;
cout << endl;
if(bayar > totaltagihandd) {
susuk = bayar - totaltagihandd;
cout << "Anda membayar sejumlah = " << bayar << endl;
cout << "Kembalian anda adalah = " << susuk << endl;
}
else if(bayar == totaltagihandd) {
cout << "Anda membayar sejumlah = " << bayar << endl;
cout << "Tidak ada kembalian untuk Anda ";
}
}
}
else if(menu == 3) {
system("cls");
petunjuk();
}
i++;
cout << endl;
system("pause");
system("cls");
cout << " ==============================================" << endl;
cout << " KERANJANG " << endl;
cout << " ==============================================" << endl; cout << " Item | Jumlah | Harga " << endl;
if(brplaptopacer > 0) {
cout <<" Laptop ACER " << brplaptopacer << " " << "Rp." << hargalaptopacer << endl;
}
if(brplaptopasus > 0) {
cout <<" Laptop ASUS " << brplaptopasus << " " << "Rp." << hargalaptopasus << endl;
}
if (brplaptoplenovo > 0) {
cout <<" Laptop LENOVO " << brplaptoplenovo<< " " << "Rp." << hargalaptoplenovo << endl;
}
if(brpmodemtelkom > 0) {
cout <<" Modem TELKOM " << brpmodemtelkom << " " << "Rp." << hargamodemtelkom << endl;
}
if(brpmodemxl > 0) {
cout <<" Modem XL " << brpmodemxl << " " << "Rp." << hargamodemxl << endl;
}
if(brpmodemsf > 0) {
cout <<" Modem SMARTFREN " << brpmodemsf << " " << "Rp." << hargamodemsf << endl;
}
if(brpjoysticksony > 0) {
cout <<" Joystick SONY " << brpjoysticksony << " " << "Rp." << hargajoysticksony << endl;
}
if(brpjoystickalpha > 0) {
cout <<" Joystick ALPHA " << brpjoystickalpha <<" " << "Rp." << hargajoystickalpha << endl;
}
if(brpjoystickmegapro > 0) {
cout <<" Joystick MEGAPRO " << brpjoystickmegapro <<" " << "Rp." << hargajoystickmegapro << endl;
}
cout << " Total tagihan pembelian sebelum diskon = Rp." << totaltagihansd << endl;
cout << "Apakah Anda ingin melihat menu lagi?" << endl;
cout << " <yes/no> " << endl;
cout << " " ;
cin >> ans;
while(ans != "yes" && ans != "no") {
cout << endl;
cout << " Inputkan <yes/no> saja" << endl;
cout << "Apakah Anda ingin melihat menu lagi?" << endl;
cout << " <yes/no> " << endl;
cout << " " ;
cin >> ans;
}
} while(ans == "yes");
system("cls");
cout << "===============================================================" << endl;
cout << " TERIMAKASIH TELAH BERKUNJUNG KE TOKO MODERN RATURU " << endl;
cout << "===============================================================" << endl << endl;
cout << "Apakah Anda ingin meluangkan waktu untuk mengisi survey Raturu " << endl;
cout << " <yes/no> " << endl;
cout << " " ;
cin >> survey;
while(survey != "yes" && survey != "no") {
cout << " Inputkan yes/no saja" ;
cout << "Apakah Anda ingin meluangkan waktu untuk mengisi survey Raturu " << endl;
cout << " <yes/no> " << endl;
cout << " " ;
cin >> survey;
}
if(survey == "yes") {
system("cls");
puas_tidakpuas();
cin >> puas;
while(puas > "5") {
cout << "Pilih nomor antara nomor 1-5 saja " << endl;
puas_tidakpuas();
cin >> puas;
}
if(puas == "1") {
puas = "Sangat puas";
} else if(puas == "2"){
puas = "Puas";
} else if(puas == "3"){
puas = "Biasa saja";
} else if(puas == "4"){
puas = "Tidak puas";
} else if(puas == "5"){
puas
= "Sangat tidak puas";
}
cout << "Nama = ";
cin.ignore();
getline(cin, nama);
cout << "Email = ";
cin.ignore();
getline(cin, email);
cout << "Alamat = ";
cin.ignore();
getline(cin, alamat);
cout << "Umur = ";
cin >> umur;
cout << "Saran untuk toko Raturu = ";
cin.ignore();
getline(cin, saran);
cout << endl;
cout << "Berikut adalah hasil pengisian survey Anda " << endl;
cout << "Nama = " << nama << endl;
cout << "Email = " << email << endl;
cout << "Alamat = " << alamat << endl;
cout << "Umur = " << umur << endl;
cout << "Saran = " << saran << endl;
cout << "Tingkat kepuasan = " << puas << endl << endl;
cout << "TERIMAKASIH TELAH MELUANGKAN WAKTU UNTUK MENGISI SURVEY RATURU " << endl;
system("pause");
}
system("cls");
cout << "Semoga harimu menyenangkan " << endl;
cout << "Have a nice day " << endl;
cout << "................" << endl;
}