-
Notifications
You must be signed in to change notification settings - Fork 0
/
ATMSystem.java
2221 lines (2021 loc) Β· 112 KB
/
ATMSystem.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
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
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Program sistem ATM - Kelompok 4 - TI-1B
// Fitur yang tersedia: autentifikasi pengguna, transfer, tarik tunai, setor tunai,
// pembayaran lain-lain, riwayat transaksi, cek saldo, ubah PIN, dan EXIT
import java.text.NumberFormat;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.format.TextStyle;
import java.util.ArrayList;
import java.util.Locale;
import java.util.List;
import java.util.Scanner;
public class ATMSystem {
static Scanner scanner1 = new Scanner(System.in);
static Scanner scanner2 = new Scanner(System.in);
static Scanner scanner3 = new Scanner(System.in);
static Scanner scanner4 = new Scanner(System.in);
static Scanner scanner5 = new Scanner(System.in);
static Scanner scannerTF = new Scanner(System.in);
private static final String red = "\u001B[31m";
private static final String green = "\u001B[32m";
private static final String reset = "\u001B[0m";
// inisialisasi dan deklarasi variabel yang dibutuhkan
// array akun di ATM POLINEMA
static String[][] accountData = {
{ "1234567", "1234", "ATABIK", "BANK POLINEMA", "7000000", "SECURE", "04-09-2023" },
{ "7654321", "5678", "FARREL", "BANK JOSS", "4000000", "SECURE", "14-11-2023" },
{ "7777777", "7777", "INNAMA", "RICH BANK", "10000000", "SECURE", "01-01-2001" },
{ "0101010", "0001", "KARL", "BANK POLINEMA", "900000000", "SECURE", "05-05-2005" },
{ "1122334", "4321", "PUTRI", "BANK POLINEMA", "23000000", "SECURE", "17-12-2023"},
{ "1231231", "1122", "AGUS", "BANK HOKI", "12000000", "SECURE", "14-02-2019"},
{ "1", "1", "RIO", "BANK JOSS", "10000000", "SECURE", "29-10-2010" }, // for quick try
{ "2", "2", "TAYLOR", "RICH BANK", "22222222", "SECURE", "29-02-2020" } // for quick try
};
// array listrikData menampung ID PLN & tagihan
static int[][] listrikData = {
{ 123123123, 100000, 1 },
{ 123456789, 70000, 1 },
{ 333444555, 80000, 1 },
};
// array pendidikanData menampung virtual account (VA) & tagihan
static int[][] pendidikanData = {
{ 232323, 1000000, 1 },
{ 454545, 2500000, 1 },
{ 909090, 5000000, 1 },
};
// array tagihan pada pdam menampung virtual account (VA) & tagihan
static int[][] tagihanAirData = {
{ 232323, 100000, 1 },
{ 454545, 250000, 1 },
{ 909090, 500000, 1 },
};
// array tagihan pada BPJS menampung virtual accounr (VA) & tagihan
static int[][] BPJSdata = {
{ 232323, 125000, 1 },
{ 454545, 250000, 1 },
{ 909090, 500000, 1 },
};
// 'Login' feature variables
static String inputUser_AccountNumber;
static int accountLineIndex = 0, loginAttempts = 1;
static boolean isAccountValid = false, isAccountNumberValid = false,
isAccountFind = false;
static final int MAX_LOGIN_ATTEMPTS = 3;
static int userChoiceMenu = 0;
// 'Transfer' feature variables
static int transferAmount;
static String inputTarget_AccountNumber;
static boolean isTargetAccountValid = false;
// 'Tarik tunai' variables
static int cashWithdrawalAmount;
static boolean isCashWithdrawalValid = false;
// Limitations the amount of transactions
static final int MAX_AMOUNT_TRANSACTION = 5000000;
// Limitations the amount of transactions
static final int MIN_AMOUNT_TRANSACTION = 50000;
// 'Setor tunai' variables
static int cashDepositAmount;
// 'Cek saldo' variables
static int userBalance = Integer.parseInt(accountData[accountLineIndex][4]);
// 'Riwayat transaksi' features variables
static ArrayList<ArrayList<String>> transactionHistoryList = new ArrayList<>();
static ArrayList<ArrayList<String>> accountHistoryList = new ArrayList<>();
// 'Exit' feature variables
static boolean isStopTransaction = false;
// Format nilai uang Indonesia Rupiah (IDR)
static NumberFormat currencyFormat = NumberFormat.getCurrencyInstance(new Locale("id", "ID"));
// 'Payment' feature variable
static int adminFee = 1000;
static String adminFeeRp = currencyFormat.format(adminFee);
// 'Listrik' feature variables
static int indexListrik = 0;
static boolean isListrikValid = false;
// 'Pendidikan' feature variables
static int indexPendidikan = 0;
static boolean isPendidikanValid = false;
// 'PDAM' feature variables
static int indexPdam = 0;
static boolean isPdamValid = false;
// 'BPJS' feature variables
static int indexBpjs = 0;
static boolean isBpjsValid = false;
// 'Return to main menu' feature variables
static boolean isGoToMainMenu = false;
// Konfirmasi transaksi ulang features variables
static char continueTransaction = 't', userChoice = 't',
userConfirmChar;
static boolean isContinueTransaction = false;
// 'Validasi PIN' variables
static String inputPin;
// Variables for choose languange feature
static int currentLanguange = 0;
static String[][] langOutputs = {
{ " PLEASE SELECT A MENU BELOW ", "SILAKAN PILIH MENU DI BAWAH INI" }, // 0
{ "TRANSFER", "TRANSFER" }, // 1
{ "CASH WITHDRAWAL", "TARIK TUNAI " }, // 2
{ "CASH DEPOSIT", "SETOR TUNAI " }, // 3
{ "PAYMENTS ", "PEMBAYARAN" }, // 4
{ "HISTORY", "RIWAYAT" }, // 5
{ "BALANCE INQUIRY", "CEK SALDO " }, // 6
{ "CHANGE PIN", "UBAH PIN " }, // 7
{ "EXIT ", "KELUAR" }, // 8
{ "HELP", "BANTUAN" }, // 9
{ "ANOTHER ACTION?", "TINDAKAN LAIN? " }, // 10
{ "YES", "YA " }, // 11
{ "NO ", "TIDAK" }, // 12
{ " INVALID INPUT. OPTION NOT AVAILABLE ", "INPUT TIDAK VALID. PILIHAN TIDAK TERSEDIA" }, // 13
{ " PLEASE INPUT CORRECTLY ", "SILAKAN INPUT YANG BENAR" }, // 14
{ "SELECT TRANSFER DESTINATION", " PILIH TUJUAN TRANSFER "}, // 15
{ "OTHER BANK ", "BANK LAINNYA"}, // 16
{ "INPUT THE DESTINATION ACCOUNT NUMBER : ", "MASUKKAN NOMOR REKENING TUJUAN : " }, // 17
{ "INPUT THE TRANSFER AMOUNT : Rp ", "MASUKKAN NOMINAL TRANSFER : Rp " }, // 18
{ "DETAIL TRANSACTION", "RINCIAN TRANSAKSI " }, // 19
{ "MAKE SURE THE FOLLOWING DATA IS CORRECT", " PASTIKAN DATA BERIKUT SESUAI "}, //20
{ "DESTINATION ACCOUNT : ", "REKENING TUJUAN : " }, // 21
{ "NAME : ", "NAMA : " }, // 22
{ "BANK : ", "BANK : " }, // 23
{ "TRANSFER AMOUNT : ", "NOMINAL TRANSFER : " }, // 24
{ "ADMIN FEE : ", "BIAYA ADMIN : " }, // 25
{ "YOUR REMAINING BALANCE : ", "SISA SALDO ANDA : " }, // 26
{ " [!] FAILED TRANSACTION. INVALID DESTINATION ACCOUNT [!] ",
"[!] TRANSAKSI GAGAL. NOMOR REKENING TUJUAN TIDAK VALID [!]" }, // 27
{ "SELECT THE NOMINAL AMOUNT", " PILIH JUMLAH NOMINAL "}, // 28
{ "OTHER AMOUNT ", "NOMINAL LAINNYA"}, //29
{"INPUT CASH WITHDRAWAL AMOUNT : Rp","MASUKKAN NOMINAL TARIK TUNAI : Rp"}, //30
{"CONFIRM CASH WITHDRAWAL : " ,"KONFIRMASI TARIK TUNAI : " },//31
{"INPUT CASH DEPOSIT AMOUNT : Rp ", "MASUKKAN NOMINAL SETOR TUNAI : Rp "}, //32
{ "CONFIRM CASH DEPOSIT : ", "KONFIRMASI SETOR TUNAI : "}, // 33
{"[===================================================================================================]\n"+
"[ CHOOSE THE PAYMENT TRANSACTION BELOW ]\n"+
"[===================================================================================================]\n"+
"[ [1] CREDIT [4] PDAM / ]\n"+
"[ WATER BILL ]\n"+
"[ ]\n"+
"[ [2] PLN / [5] BPJS / ]\n"+
"[ ELECTRIC BILL HEALTH INSURANCE ]\n"+
"[ ]\n"+
"[ [3] EDUCATION [6] BACK TO THE ]\n"+
"[ MAIN MENU ]\n"+
"[ ]\n"+
"[===================================================================================================]",
"[===================================================================================================]\n"+
"[ SILAKAN PILIH TRANSAKSI PEMBAYARAN BERIKUT ]\n"+
"[===================================================================================================]\n"+
"[ [1] PULSA [4] PDAM / ]\n"+
"[ TAGIHAN AIR ]\n"+
"[ ]\n"+
"[ [2] PLN / [5] BPJS / ]\n"+
"[ TAGIHAN LISTRIK ASURANSI KESEHATAN ]\n"+
"[ ]\n"+
"[ [3] PENDIDIKAN [6] KEMBALI KE ]\n"+
"[ MENU UTAMA ]\n"+
"[===================================================================================================]"}, //34
{ "CHOOSE AN OPERATOR CELLULER", " PILIH OPERATOR SELULER " }, //35
{ "THE OPERATOR YOU SELECTED IS INVALID", "OPERATOR YANG ANDA PILIH TIDAK VALID" }, //36
{ "INPUT PHONE NUMBER : ", "MASUKKAN NOMOR TELEPON : "}, // 37
{ "INPUT CREDIT AMOUNT : Rp", "MASUKKAN NOMINAL PULSA : Rp"}, //38
{ "CELLULER PROVIDER : ", "OPERATOR SELULER : "}, // 39
{ "PHONE NUMBER : ", "NOMOR TELEPON : "}, // 40
{ "CREDIT AMOUNT : ", "NOMINAL PULSA : "}, // 41
{ "INPUT PAYMENT CODE : ", "MASUKKAN KODE PEMBAYARAN : "}, // 42
{ "PAYMENT CODE : ", "KODE PEMBAYARAN : "}, //43
{ "AMOUNT OF BILL : ", "JUMLAH TAGIHAN : "}, // 44
{ "TRANSACTION HISTORY", "RIWAYAT TRANSAKSI "}, // 45
{ "ACCOUNT HISTORY", "RIWAYAT AKUN "}, // 46
{ "YOUR RECENT TRANSACTION HISTORY", "RIWAYAT TRANSAKSI TERBARU ANDA "}, // 47
{ " AMOUNT", "NOMINAL"}, // 48
{ "TIME ", "WAKTU"}, // 49
{ " DATE ", "TANGGAL"}, //50
{ "TRANSFER TO ACCOUNT ", "TRANSFER KE REKENING "}, // 51
{ "CASH WITHDRAWAL ", "TARIK TUNAI " }, // 52
{ "CASH DEPOSIT ", "SETOR TUNAI " }, //53
{ "BUY CREDIT TO NUMBER ", "BELI PULSA KE NOMOR "}, //54
{ "PAY ELECTRICITY BILL ", "BAYAR TAGIHAN LISTRIK "}, // 55
{ "PAY EDUCATION COST ", "BAYAR BIAYA PENDIDIKAN "}, // 56
{ "PAY WATER BILL ", "BAYAR TAGIHAN AIR "}, //57
{ "PAY HEALTH INSURANCE ", "BAYAR ASURANSI KESEHATAN "}, //58
{ "YOUR RECENT ACCOUNT HISTORY", " RIWAYAT AKUN TERBARU ANDA "}, //59
{ "ACCOUNT CREATED", "AKUN DIBUAT "}, //60
{ "HAVE MADE A PIN CHANGE", "TELAH MELAKUKAN PERUBAHAN PIN"}, //61
{ "YOUR BALANCE AMOUNT : ","SALDO ANDA SEBESAR : "}, //62
{ "ARE YOU SURE WANT TO EXIT? ", "APAKAH ANDA YAKIN UNTUK KELUAR?" }, // 63
{ "[ ADD THE BANK CODE AT THE BEGINNING ]\n"+
"[ WHEN INPUT THE ACCOUNT NUMBER ]\n"+
"[ ----------------------------------------------- ]\n"+
"[ INTERBANK TRANSFER WILL INCUR AN ADMIN FEE ]\n"+
"[ OF Rp1.500 PER TRANSACTION ]\n",
"[ TAMBAHKAN KODE BANK PADA SAAT AWAL ]\n"+
"[ MEMASUKKAN NOMOR REKENING ]\n"+
"[ ----------------------------------------------- ]\n"+
"[ TRANSFER ANTARBANK AKAN DIKENAKAN BIAYA ADMIN ]\n"+
"[ SEBESAR Rp1.500 TIAP TRANSAKSI ]\n" }, // 64
{ "VIEW BANK CODE ", "LIHAT CODE BANK"}, // 65
{ "CONTINUE ", "LANJUTKAN"}, // 66
{ "BACK ", "KEMBALI"}, // 67
{ "[ INPUT THE DESTINATION ACCOUNT NUMBER ]\n"+
"[ STARTING WITH THE BANK CODE ]\n",
"[ MASUKKAN NOMOR REKENING TUJUAN ]\n"+
"[ DENGAN DIAWALI KODE BANK ]\n" }, // 68
{ "[ PLEASE INPUT THE SEVEN DIGIT ]\n"+
"[ DESTINATION ACCOUNT NUMBER ]\n",
"[ SILAKAN MASUKKAN TUJUH DIGIT ]\n"+
"[ NOMOR REKENING TUJUAN ]\n"}, // 69
{ " "," " }, // 70
{ "INSERT YOUR PIN : ","MASUKKAN PIN ANDA : "}, // 71
{ "INSERT A NEW PIN: ", "MASUKKAN PIN BARU: "}, // 72
{ "CONFIRM A NEW PIN: ","KONFIRMASI PIN BARU: "}, // 73
{ " [!] PIN CHANGED [!] ", "[!] PIN BERHASIL DIRUBAH [!]" }, // 74
{ "[!] A NEW PIN AND CONFIRM MUST BE THE SAME [!]", " [!] PIN BARU DAN KONFIRMASI TIDAK SAMA [!] " }, // 75
{ " [!] INCORRECT PIN [!] ", "[!] PIN TIDAK SESUAI [!]" }, // 76
{ "CONFIRM TRANSACTION ? ", "KONFIRMASI TRANSAKSI ?" }, // 77
{ "[===================================================================================================]\n"+
"[ SORRY, INVALID TRANSACTION ]\n"+
"[ TRANSAKSI VALID MUST BE BETWEEN Rp50.000 - Rp5.000.000 ]\n"+
"[===================================================================================================]",
"[===================================================================================================]\n"+
"[ MOHON MAAF, TRANSAKSI TIDAK VALID ]\n"+
"[ TRANSAKSI VALID JIKA NOMINAL Rp50.000 HINGGA Rp5.000.000 ]\n"+
"[===================================================================================================]" }, // 78
{ "[!] TRANSACTION FAILED. YOUR BALANCE IS INSUFFICIENT [!]", " [!] TRANSAKSI GAGAL. SALDO ANDA TIDAK MENCUKUPI [!] " }, // 79
{ "[!] WRONG PIN [!]", "[!] PIN SALAH [!] " }, // 80
{ "[~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ TRANSACTION SUCCESS ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~]\n",
"[~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ TRANSAKSI BERHASIL~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~]\n" }, // 81
{ "[!] CANCELED TRANSACTION [!]", "[!] TRANSAKSI DIBATALKAN [!]" }, // 82
{ "[ [!] INVALID PAYMENT CODE [!] ]\n"+
"[ PLEASE RECHECK THE PAYMENT CODE ]\n",
"[ [!] KODE PEMBAYARAN TIDAK VALID [!] ]\n"+
"[ SILAKAN INPUT ULANG KODE PEMBAYARAN ]\n" }, // 83
{ "[ [!] INVALID PAYMENT CODE [!] ]\n"+
"[ CODE HAS BEEN USED ]\n",
"[ [!] KODE PEMBAYARAN TIDAK VALID [!] ]\n"+
"[ KODE PEMBAYARAN TELAH DIGUNAKAN ]\n" }, //84
{ "Press 'Y' For yes. press 'T' for No --> ","Tekan 'Y' untuk YA. Tekan 'T' untuk TIDAK --> " }, //85
{ "INSERT PIN : ","MASUKKAN PIN : " }, //86
{ "ENTER FOR CONTINUE ==> ","ENTER UNTUK MELANJUTKAN ==> " }, //87
{ "BACK TO THE", "KEMBALI KE "}, // 88
{ "MAIN MENU ", "MENU UTAMA" }, // 89
{ "[~ ~ ~ ~ ~ ~ ~ ~ ~ ~ THANK YOU FOR TRANSACTING! MAY YOUR DAY ALWAYS BE HAPPY :) ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ]\n",
"[~ ~ ~ ~ ~ ~ ~ ~ ~TERIMA KASIH TELAH BERTRANSAKSI! SEMOGA HARIMU SELALU BAHAGIA :) ~ ~ ~ ~ ~ ~ ~ ~ ~]\n" }, // 90
{ "[===================================================================================================]\n"+
"[ INSTRUCTIONS FOR USING POLINEMA ATM ]\n"+
"[ ]\n"+
"[ Q: HOW TO MAKE A TRANSACTION? ]\n"+
"[ A: YOU CAN SELECT TRANSACTION OPTIONS BY SELECTING THE NUMBER OPTIONS IN THE MENU ]\n"+
"[ ]\n"+
"[ Q: CAN I TRANSACTION MORE THAN ONE TIME? ]\n"+
"[ A: OF COURSE. AFTER YOU CONFIRM, THERE WILL BE A NOTIFICATION REGARDING THE TRANSACTION ]\n"+
"[ CONFIRMATION AGAIN. YOU CAN SELECT THE MENU THAT IS BACK AVAILABLE. ]\n"+
"[ ]\n"+
"[ IF THERE ARE OTHER PROBLEMS PLEASE CONTACT CALL CENTER 00112233 ]\n"+
"[ WE WILL BE HAPPY TO SERVE YOU ]\n"+
"[===================================================================================================]",
"[===================================================================================================]\n"+
"[ PETUNJUK MENGGUNAKAN ATM POLINEMA ]\n"+
"[ ]\n"+
"[ Q: BAGAIMANA CARA MELAKUKAN TRANSAKSI? ]\n"+
"[ A: ANDA BISA MEMILIH OPSI TRANSAKSI DENGAN MEMILIH OPSI ANGKA YANG ADA DI MENU ]\n"+
"[ ]\n"+
"[ Q: APAKAH SAYA BISA TRANSAKSI LEBIH DARI 1 KALI? ]\n"+
"[ A: BISA. SETELAH ANDA MELAKUKAN KONFIRMASI, AKAN ADA PEMBERITAHUAN MENGENAI KONFIRMASI ]\n"+
"[ TRANSAKSI LAGI. ANDA BISA MEMILIH MENU YANG TERSEDIA KEMBALI. ]\n"+
"[ ]\n"+
"[ JIKA ADA KENDALA LAIN SILAKAN HUBUNGI CALL CENTER 00112233 ]\n"+
"[ KAMI DENGAN SENANG HATI AKAN MELAYANI ANDA ]\n"+
"[===================================================================================================]" }, // 91
{ "[!] PIN ONLY CONSIST OF 4 DIGIT NUMBERS [!] ", "[!] PIN HANYA TERDIRI DARI 4 DIGIT ANGKA [!]" }, // 92
{ "PIN IS STILL THE SAME AS BEFORE ", "PIN MASIH SAMA DENGAN SEBELUMNYA" }, // 93
{ " [!] THE INPUT PROVIDED IS INVALID. PLEASE REPEAT AGAIN [!] ", "[!] INPUT YANG DIBERIKAN TIDAK VALID. SILAKAN ULANGI LAGI [!]" }, // 94
{ " [!] THE VALUE MUST BE GREATER OR EQUAL TO ZERO [!] ", "[!] NILAI HARUS LEBIH BESAR ATAU SAMA DENGAN NOL [!]" } // 95
};
public static void main(String[] args) {
while (!isAccountValid) {
PageMenu();
Login();
}
chooseLanguange();
Menu();
}
public static void PageMenu() {
ClearScreen();
System.out.println(
"[===================================================================================================]\n"+
"[ " + formattedLocalDate() + " " + formattedLocalDay()+ " " + formattedLocalTime() + " ]\n" +
"[===================================================================================================]\n"+
"[ ββββββ βββββββββββββ ββββ βββββββ βββββββ βββ βββββββ βββββββββββββββ ββββ ββββββ ]\n"+
"[ ββββββββββββββββββββββ βββββ ββββββββββββββββββββ ββββββββ ββββββββββββββββ βββββββββββββ ]\n"+
"[ ββββββββ βββ βββββββββββ βββββββββββ ββββββ βββββββββ βββββββββ βββββββββββββββββββ ]\n"+
"[ ββββββββ βββ βββββββββββ βββββββ βββ ββββββ βββββββββββββββββββ βββββββββββββββββββ ]\n"+
"[ βββ βββ βββ βββ βββ βββ βββ βββββββββββββββββββββββ βββββββββββββββββ βββ ββββββ βββ ]\n"+
"[ βββ βββ βββ βββ βββ βββ βββββββ ββββββββββββββ ββββββββββββββββ ββββββ βββ ]\n"+
"[===================================================================================================]\n"+
"[ ]\n"+
"[ .@@@@. _ _ _____ _ _____ ________ ___ _____ ]\n"+
"[ @:=:@@@@@@:=:@ | | | | ___| | / __ \\ _ | \\/ || ___| ]\n"+
"[ @:-:@@@@====@@@@:-:@ | | | | |__ | | | / \\/ | | | . . || |__ ]\n"+
"[ @:-@@@::::::::::::::@@@-:@ | |/\\| | __|| | | | | | | | |\\/| || __| ]\n"+
"[ @:-@@::@@@@@@@@@@@@@@@@::@@-:@ \\ /\\ / |___| |___| \\__/\\ \\_/ / | | || |___ ]\n"+
"[ @:-@@::@@@@@ ******** @@@@@::@@-:@ \\/ \\/\\____/\\_____/\\____/\\___/\\_| |_/\\____/ ]\n"+
"[ @:-@@@:@@@@: ***++**++*** :@@@:@@@-:@ ]\n"+
"[ @:-@@::@@@: ***++- !! -++*** :@@@::@@-:@ ]\n"+
"[ @:@@::@@@@ ***++- .||. -++*** @@@@::@@:@ PLEASE INPUT YOUR ACCOUNT NUMBER ]\n"+
"[ @:@@@@@@@@ **+++- .||. -+++** @@@@@@@@:@ AND YOUR PIN ]\n"+
"[ @:#@@@@: ***+++=- .||. -=+++*** :@@@@#:@ ________________________________ ]\n"+
"[ @:+@@@@ ****++--. +||+ .--++**** @@@@+:@ SILAKAN MASUKKAN NOMOR REKENING ]\n"+
"[ :@:@@@@. ***-++.. +--+ ..++-*** .@@@@:@: DAN PIN ANDA ]\n"+
"[ @:*@@@@@@ ***** *#::#* ***** @@@@@@*:@ ]\n"+
"[ @:-@@@@@@ **** ====== **** @@@@@@-:@ ]\n"+
"[ @:-@@@@@. ***####%%####*** .@@@@@-:@ FOR SAFETY AND COMFORT ]\n"+
"[ @:.@@@@@ ################ @@@@@.:@ PLEASE CHANGE YOUR PIN REGULARLY ]\n"+
"[ @: @@@@@@+:. ---- .:+@@@@@@ :@ ________________________________ ]\n"+
"[ @:* @@@ =@@@@@@@@@@@= @@@ :@ DEMI KEAMANAN DAN KENYAMANAN ]\n"+
"[ @* :*@@@@@@@@@@@@@@*: *@ SILAKAN GANTI PIN ANDA ]\n"+
"[ @@@#+-:....:-+#@@@ SECARA BERKALA ]\n"+
"[ ]\n"+
"[===================================================================================================]");
}
public static boolean Login() {
loginAttempts = 0;
boolean tryToLogin = false;
do {
System.out.print("[ ACCOUNT NUMBER: ");
inputUser_AccountNumber = scanner2.nextLine();
// Pengecekan kesesuaian input nomor rekening dengan data yang ada
isAccountFind = false;
for (int i = 0; i < accountData.length; i++) {
if (inputUser_AccountNumber.equals(accountData[i][0])) {
isAccountFind = true;
accountLineIndex = i;
break;
}
}
if (!isAccountFind) {
System.out.println(
"[===================================================================================================]\n"+
"[ ACCOUNT NUMBER IS NOT FOUND. PLEASE INPUT YOUR CORRECT ACCOUNT NUMBER ]\n"+
"[ [!] _____________________________________________________________________ [!] ]\n"+
"[ NOMOR REKENING TIDAK DITEMUKAN. MOHON MASUKKAN NOMOR REKENING YANG BENAR ]\n"+
"[===================================================================================================]\n");
EnterForContinue();
ClearScreen();
return false;
}
isAccountNumberValid = false;
if (isAccountFind) {
if (accountData[accountLineIndex][5].equals("SECURE")) {
isAccountNumberValid = true;
}
}
if (isAccountNumberValid) {
// Check the PIN with a maximum of MAX_LOGIN_ATTEMPTS attempts
for (loginAttempts = 1; loginAttempts <= MAX_LOGIN_ATTEMPTS; loginAttempts++) {
// Check if the entered PIN matches the account PIN
if (PinValidation()) {
isAccountValid = true;
return true; // Successful login
} else {
ClearScreen();
WrongPin();
System.out.println(
"[===================================================================================================]\n"+
"[ LOGIN ATTEMPTS [=====] / [=====] ]\n"+
"[ ______________ [ " + loginAttempts+ " ] / [ " + MAX_LOGIN_ATTEMPTS + " ] ]\n" +
"[ PERCOBAAN MASUK [=====] / [=====] ]\n"+
"[===================================================================================================]");
EnterForContinue();
}
}
} else {
tryToLogin = true;
ClearScreen();
System.out.println(
"[===================================================================================================]\n"+
"[ YOUR ACCOUNT (" + inputUser_AccountNumber+ ") HAS BEEN BLOCKED. PLEASE INPUT ANOTHER ACCOUNT NUMBER ]\n" +
"[ [!] _______________________________________________________________________________________ [!] ]\n"+
"[ NOMOR REKENING ANDA (" + inputUser_AccountNumber+ ") TELAH DIBLOKIR. SILAKAN MASUKKAN NOMOR REKENING YANG LAIN ]\n" +
"[===================================================================================================]");
EnterForContinue();
return false;
}
if (loginAttempts > MAX_LOGIN_ATTEMPTS) {
System.out.println(
"[===================================================================================================]\n"+
"[ YOU HAVE INPUT YOUR PIN INCORRECTLY 3 TIMES. SORRY, WE HAVE BLOCKED YOUR ACCOUNT ]\n"+
"[ [!] ________________________________________________________________________________ [!] ]\n"+
"[ ANDA TELAH SALAH MEMASUKKAN PIN SEBANYAK 3 KALI. MOHON MAAF, NOMOR REKENING ANDA KAMI BLOKIR ]\n"+
"[===================================================================================================]");
accountData[accountLineIndex][5] = "BLOCKED";
EnterForContinue();
}
} while (tryToLogin || !isAccountFind);
return false;
}
public static void WrongPin() {
System.out.println(
"[===================================================================================================]\n"+
"[ LOGIN FAILED. PLEASE CHECK YOUR PIN AGAIN ]\n"+
"[ [!] _________________________________________ [!] ]\n"+
"[ GAGAL MASUK. SILAKAN CEK PIN ANDA KEMBALI ]\n"+
"[===================================================================================================]");
}
public static void chooseLanguange() {
boolean isLoopConfirm = false;
do {
System.out.println(
"[===================================================================================================]\n"+
"[ PLEASE SELECT THE LANGUAGE TO BE USED ]\n"+
"[ ______________________________________ ]\n"+
"[ MOHON PILIH BAHASA YANG AKAN DIGUNAKAN ]\n"+
"[===================================================================================================]\n"+
"[ ]\n"+
"[ [1] [ENGLISH] ]\n"+
"[ ]\n"+
"[ [2] [BAHASA INDONESIA] ]\n"+
"[ ]\n"+
"[===================================================================================================]");
System.out.print("[ ==> ");
currentLanguange = scanner1.nextInt();
if (currentLanguange >= 3) {
isLoopConfirm = true;
currentLanguange = 0;
defaultCaseMenu();
EnterForContinue();
} else {
currentLanguange -= 1;
isLoopConfirm = false;
}
} while (isLoopConfirm);
}
public static void Menu() {
do {
isGoToMainMenu = false;
ClearScreen();
System.out.println(
"[===================================================================================================]\n"+
"[ " + langOutputs[0][currentLanguange]+ " ]\n" +
"[===================================================================================================]\n"+
"[ ]\n"+
"[ [1] " + langOutputs[1][currentLanguange]+ " " + "[5] " + langOutputs[5][currentLanguange]+ " ]\n" +
"[ ]\n"+
"[ [2] " + langOutputs[2][currentLanguange] + " "+ "[6] " + langOutputs[6][currentLanguange] + " ]\n" +
"[ ]\n"+
"[ [3] " + langOutputs[3][currentLanguange] + " "+ "[7] " + langOutputs[7][currentLanguange] + " ]\n" +
"[ ]\n"+
"[ [4] " + langOutputs[4][currentLanguange] + " "+ "[8] " + langOutputs[8][currentLanguange] + " ]\n" +
"[ ]\n"+
"[ [9] "+ langOutputs[9][currentLanguange] + " ]\n" +
"[ ]\n"+
"[===================================================================================================]");
System.out.print("[ ==> ");
userChoiceMenu = scanner2.nextInt();
ClearScreen();
switch (userChoiceMenu) {
case 1:
Transfer();
break;
case 2:
TarikTunai();
break;
case 3:
SetorTunai();
break;
case 4:
PembayaranLainnya();
break;
case 5:
History();
break;
case 6:
CekSaldo();
break;
case 7:
UbahPin();
break;
case 8:
Exit();
break;
case 9:
displayHelp();
break;
default:
defaultCaseMenu();
break;
}
if (isStopTransaction) {
isContinueTransaction = false;
}
if (userChoiceMenu != 8) {
if (!isGoToMainMenu) {
boolean isLoopConfirm = false;
do {
System.out.println(
"[===================================================================================================]\n"+
"[ " + langOutputs[10][currentLanguange]+ " ]\n"+
"[ ]\n"+
"[ [1] " + langOutputs[11][currentLanguange]+ " ]\n"+
"[ ]\n"+
"[ [2] " + langOutputs[12][currentLanguange]+ " ]\n"+
"[ ]\n"+
"[===================================================================================================]");
System.out.print("[ ==> ");
continueTransaction = scanner2.next().charAt(0);
ClearScreen();
switch (continueTransaction) {
case '1':
isContinueTransaction = true;
isLoopConfirm = false;
break;
case '2':
displayClosing();
isContinueTransaction = false;
isLoopConfirm = false;
break;
default:
defaultCaseMenu();
EnterForContinue();
isLoopConfirm = true;
break;
}
} while (isLoopConfirm);
}
}
} while (isContinueTransaction);
}
public static void displayHeaderTransfer() {
System.out.println(
"[===================================================================================================]\n"+
"[ - - - - - - - - - - - - - - - - - - -ββ¦ββ¦ββββββββββββββββββ¦ββ- - - - - - - - - - - - - - - - - - -]\n"+
"[ - - - - - - - - - - - - - - - - - - - β β β¦ββ ββ£βββββββ β£ ββ£ β β¦β- - - - - - - - - - - - - - - - - - -]\n"+
"[ - - - - - - - - - - - - - - - - - - - β© β©βββ© β©βββββββ ββββ©ββ- - - - - - - - - - - - - - - - - - -]\n"+
"[===================================================================================================]");
}
public static void Transfer() {
displayHeaderTransfer();
System.out.println(
"[===================================================================================================]\n"+
"[ "+langOutputs[15][currentLanguange]+" ]\n"+
"[===================================================================================================]\n"+
"[ [1] BANK POLINEMA [3] "+langOutputs[88][currentLanguange]+" ]\n"+
"[ "+langOutputs[89][currentLanguange]+" ]\n"+
"[ [2] "+langOutputs[16][currentLanguange]+" ]\n"+
"[===================================================================================================]");
System.out.print("[ ==> ");
int bankChoice = scanner1.nextInt();
ClearScreen();
switch (bankChoice) {
case 1:
transferSameBank();
EnterForContinue();
break;
case 2:
transferOtherBank();
EnterForContinue();
break;
case 3:
returnToMainMenu();
break;
default:
defaultCaseMenu();
}
}
public static void transferSameBank() {
System.out.println(
"[===================================================================================================]\n"+
langOutputs[69][currentLanguange]+
"[===================================================================================================]"
);
System.out.print("[ " + langOutputs[17][currentLanguange]);
inputTarget_AccountNumber = scannerTF.nextLine();
int indexTargetAccount = accountLineIndex;
isTargetAccountValid = false;
boolean isTryToCheckBank = false;
for (int i = 0; i < accountData.length; i++) {
if ((inputTarget_AccountNumber.equals(accountData[i][0])) && (!inputTarget_AccountNumber.equals(inputUser_AccountNumber))) {
indexTargetAccount = i;
break;
}
}
if (indexTargetAccount == accountLineIndex) {
isTryToCheckBank = false;
} else {
isTryToCheckBank = true;
}
if (isTryToCheckBank) {
if (accountData[indexTargetAccount][0].equals(inputTarget_AccountNumber)) {
if (accountData[indexTargetAccount][3].equals("BANK POLINEMA")) {
isTargetAccountValid = true;
}
}
}
if (isTargetAccountValid) {
int adminFeeTf = 0;
String adminFeeTfRp = currencyFormat.format(adminFeeTf);
transferAmount = validateNonNegativeIntegerInput("[ " + langOutputs[18][currentLanguange]);
String transferAmountRupiah = currencyFormat.format(transferAmount);
int totalTransfer = transferAmount + adminFeeTf;
String totalTransferRp = currencyFormat.format(totalTransfer);
ClearScreen();
System.out.println(
"[===================================================================================================]\n"+
"[ " + langOutputs[19][currentLanguange]+ " ]\n" +
"[ " + langOutputs[20][currentLanguange]+ " ]\n" +
"[ _______________________________________ ]\n"+
"[ -- " + langOutputs[21][currentLanguange] + inputTarget_AccountNumber + "\n" +
"[ -- " + langOutputs[22][currentLanguange] + accountData[indexTargetAccount][2] + "\n"+
"[ -- " + langOutputs[23][currentLanguange] + accountData[indexTargetAccount][3] + "\n"+
"[ -- " + langOutputs[24][currentLanguange] + transferAmountRupiah + "\n" +
"[ -- " + langOutputs[25][currentLanguange] + adminFeeTfRp + "\n" +
"[===================================================================================================]\n"+
"[ "+langOutputs[77][currentLanguange]+" ]"
);
if (UserConfirmation()) {
if (PinValidation()) {
if (transferAmount < userBalance) {
if (transferAmount <= MAX_AMOUNT_TRANSACTION && transferAmount >= MIN_AMOUNT_TRANSACTION) {
userBalance -= totalTransfer;
String userBalanceRupiah = currencyFormat.format(userBalance);
viewTransactionSuccess();
System.out.println(
"[===================================================================================================]\n"+
"[ "+ langOutputs[19][currentLanguange]+ " ]\n" +
"[ ______________________ ]\n"+
"[ -- " + langOutputs[21][currentLanguange] + inputTarget_AccountNumber+ "\n" +
"[ -- " + langOutputs[22][currentLanguange]+ accountData[indexTargetAccount][2] + "\n" +
"[ -- " + langOutputs[23][currentLanguange]+ accountData[indexTargetAccount][3] + "\n" +
"[ -- " + langOutputs[24][currentLanguange] + transferAmountRupiah+ "\n" +
"[ -- " + langOutputs[25][currentLanguange] + adminFeeTfRp + "\n" +
"[ -- " + langOutputs[26][currentLanguange] + userBalanceRupiah + "\n"+
"[===================================================================================================]"
);
// Recording transaction history
transactionHistoryList.add(new ArrayList<>(List.of(langOutputs[51][currentLanguange] + inputTarget_AccountNumber + " ("+ accountData[indexTargetAccount][2] + ")", adjustNumCharHistory(totalTransferRp), formattedLocalTime(), formattedLocalDate())));
recordTransactionHistory();
} else {
displayTransactionOverLimit();
}
} else {
viewBalanceIsNotEnough();
}
} else {
viewWrongPin();
}
} else {
viewTransactionCancelled();
}
} else {
ClearScreen();
System.out.println(
"[===================================================================================================]\n"+
"[ " + red + langOutputs[27][currentLanguange] + reset+ " ]\n" +
"[===================================================================================================]"
);
}
}
public static void transferOtherBank() {
Scanner scanTfOtherBank = new Scanner(System.in);
System.out.println(
"[===================================================================================================]\n"+
langOutputs[64][currentLanguange]+
"[===================================================================================================]\n"+
"[ [1] "+langOutputs[65][currentLanguange]+" ]\n"+
"[ ]\n"+
"[ [2] "+langOutputs[66][currentLanguange]+" ]\n"+
"[===================================================================================================]"
);
System.out.print("[ ==> ");
userChoiceMenu = scanTfOtherBank.nextInt();
ClearScreen();
switch (userChoiceMenu) {
case 1:
displayBankCode();
break;
case 2:
exeTransferOtherBank();
break;
default:
defaultCaseMenu();
}
}
public static void displayBankCode() {
System.out.print(
"[===================================================================================================]\n"+
"[ 001 - BANK JOSS ]\n"+
"[ 002 - RICH BANK ]\n"+
"[ 003 - GOOD BANK ]\n"+
"[ 004 - BANK HOKI ]\n"+
"[===================================================================================================]\n"+
"[ [1] "+langOutputs[67][currentLanguange]+" ]\n"+
"[===================================================================================================]\n"+
"[ ==> "
);
userChoiceMenu = scanner2.nextInt();
ClearScreen();
if (userChoiceMenu == 1) {
transferOtherBank();
} else {
defaultCaseMenu();
}
}
public static void exeTransferOtherBank() {
System.out.println(
"[===================================================================================================]\n"+
langOutputs[68][currentLanguange]+
"[===================================================================================================]"
);
System.out.print("[ " + langOutputs[17][currentLanguange]);
inputTarget_AccountNumber = scannerTF.nextLine();
String bankCode = inputTarget_AccountNumber.substring(0, 3);
boolean isBankCodeValid = false;
String targetAccountNumber = inputTarget_AccountNumber.substring(3);
// Checking bank code availibility
if (bankCode.equals("001") || bankCode.equals("002") || bankCode.equals("003") || bankCode.equals("004")) {
isBankCodeValid = true;
}
// Checking target account availibility
int indexTargetAccount = 0;
isTargetAccountValid = false;
if (isBankCodeValid) {
for (int i = 0; i < accountData.length; i++) {
if ((targetAccountNumber.equals(accountData[i][0])) && (!targetAccountNumber.equals(inputUser_AccountNumber))) {
indexTargetAccount = i;
break;
}
}
if (bankCode.equals("001")) {
if (accountData[indexTargetAccount][3].equals("BANK JOSS")) {
isTargetAccountValid = true;
}
} else if (bankCode.equals("002")) {
if (accountData[indexTargetAccount][3].equals("RICH BANK")) {
isTargetAccountValid = true;
}
} else if (bankCode.equals("003")) {
if (accountData[indexTargetAccount][3].equals("GOOD BANK")) {
isTargetAccountValid = true;
}
} else if (bankCode.equals("004")) {
if (accountData[indexTargetAccount][3].equals("BANK HOKI")) {
isTargetAccountValid = true;
}
}
}
if (isTargetAccountValid) {
int adminFeeTf = 1500;
String adminFeeTfRp = currencyFormat.format(adminFeeTf);
transferAmount = validateNonNegativeIntegerInput("[ " + langOutputs[18][currentLanguange]);
String transferAmountRupiah = currencyFormat.format(transferAmount);
int totalTransfer = transferAmount + adminFeeTf;
String totalTransferRp = currencyFormat.format(totalTransfer);
ClearScreen();
System.out.println(
"[===================================================================================================]\n"+
"[ " + langOutputs[19][currentLanguange]+ " ]\n" +
"[ " + langOutputs[20][currentLanguange]+ " ]\n" +
"[ _______________________________________ ]\n"+
"[ -- " + langOutputs[21][currentLanguange] + targetAccountNumber + "\n" +
"[ -- " + langOutputs[22][currentLanguange] + accountData[indexTargetAccount][2] + "\n"+
"[ -- " + langOutputs[23][currentLanguange] + accountData[indexTargetAccount][3] + "\n"+
"[ -- " + langOutputs[24][currentLanguange] + transferAmountRupiah + "\n" +
"[ -- " + langOutputs[25][currentLanguange] + adminFeeTfRp + "\n" +
"[===================================================================================================]\n"+
"[ "+langOutputs[77][currentLanguange]+" ]"
);
if (UserConfirmation()) {
if (PinValidation()) {
if (transferAmount < userBalance) {
if (transferAmount <= MAX_AMOUNT_TRANSACTION && transferAmount >= MIN_AMOUNT_TRANSACTION) {
userBalance -= totalTransfer;
String userBalanceRupiah = currencyFormat.format(userBalance);
viewTransactionSuccess();
System.out.println(
"[===================================================================================================]\n"+
"[ "+ langOutputs[19][currentLanguange]+ " ]\n" +
"[ ______________________ ]\n"+
"[ -- " + langOutputs[21][currentLanguange] + targetAccountNumber+ "\n" +
"[ -- " + langOutputs[22][currentLanguange]+ accountData[indexTargetAccount][2] + "\n" +
"[ -- " + langOutputs[23][currentLanguange]+ accountData[indexTargetAccount][3] + "\n" +
"[ -- " + langOutputs[24][currentLanguange] + transferAmountRupiah+ "\n" +
"[ -- " + langOutputs[25][currentLanguange] + adminFeeTfRp + "\n" +
"[ -- " + langOutputs[26][currentLanguange] + userBalanceRupiah + "\n"+
"[===================================================================================================]"
);
// Recording transaction history
transactionHistoryList.add(new ArrayList<>(List.of(langOutputs[51][currentLanguange] + inputTarget_AccountNumber + " ("+ accountData[indexTargetAccount][2] + ")", adjustNumCharHistory(totalTransferRp), formattedLocalTime(), formattedLocalDate())));
recordTransactionHistory();
} else {
displayTransactionOverLimit();
}
} else {
viewBalanceIsNotEnough();
}
} else {
viewWrongPin();
}
} else {
viewTransactionCancelled();
}
} else {
ClearScreen();
System.out.println(
"[===================================================================================================]\n"+
"[ " + red + langOutputs[27][currentLanguange] + reset+ " ]\n" +
"[===================================================================================================]"
);
}
}
public static void displayHeaderCashWithdrawal() {
if (currentLanguange == 0) {
System.out.println(
"[===================================================================================================]\n"+
"[- - - - - - - - - - - - - - -ββββββββββ¦ β¦ β¦ β¦β¦ββ¦ββ¦ β¦ββ¦ββ¦ββββββ¦ β¦ββββ¦ - - - - - - - - - - - - - - -]\n"+
"[- - - - - - - - - - - - - - -β β ββ£ββββ ββ£ ββββ β β ββ£ βββ β¦ββ ββ£ββββ ββ£β - - - - - - - - - - - - - - -]\n"+
"[- - - - - - - - - - - - - - -ββββ© β©ββββ© β© ββ©ββ© β© β© β©ββ©ββ©βββ© β©ββ©ββ© β©β©ββ - - - - - - - - - - - - - -]\n"+
"[===================================================================================================]");
} else {
System.out.println(
"[===================================================================================================]\n"+
"[- - - - - - - - - - - - - - - - - - -ββ¦βββββ¦βββ¦β¦ββ ββ¦ββ¦ β¦βββββββ¦ - - - - - - - - - - - - - - - - -]\n"+
"[- - - - - - - - - - - - - - - - - - - β β ββ£β β¦βββ β©β β β βββββ ββ£β - - - - - - - - - - - - - - - - -]\n"+
"[- - - - - - - - - - - - - - - - - - - β© β© β©β©βββ©β© β© β© βββββββ© β©β© - - - - - - - - - - - - - - - - -]\n"+
"[===================================================================================================]");
}
}
public static void TarikTunai() {
displayHeaderCashWithdrawal();
System.out.println(
"[===================================================================================================]\n"+
"[ " + langOutputs[28][currentLanguange]+ " ]\n" +
"[ _________________________ ]\n"+
"[ [1] Rp50.000 [5] Rp500.000 ]\n"+
"[ ]\n"+
"[ [2] Rp100.000 [6] Rp750.000 ]\n"+
"[ ]\n"+
"[ [3] Rp200.000 [7] Rp1.000.000 ]\n"+
"[ ]\n"+
"[ [4] Rp300.000 [8] "+ langOutputs[29][currentLanguange] + " ]\n" +
"[===================================================================================================]");
System.out.print("[ ==> ");
int cashWithdrawalChoice = scanner1.nextInt();
ClearScreen();
isCashWithdrawalValid = false;
switch (cashWithdrawalChoice) {
case 1:
cashWithdrawalAmount = 50000;
isCashWithdrawalValid = true;
break;
case 2:
cashWithdrawalAmount = 100000;
isCashWithdrawalValid = true;
break;
case 3:
cashWithdrawalAmount = 200000;
isCashWithdrawalValid = true;
break;
case 4:
cashWithdrawalAmount = 300000;
isCashWithdrawalValid = true;
break;
case 5:
cashWithdrawalAmount = 500000;
isCashWithdrawalValid = true;
break;
case 6:
cashWithdrawalAmount = 750000;
isCashWithdrawalValid = true;
break;
case 7:
cashWithdrawalAmount = 1000000;
isCashWithdrawalValid = true;
break;
case 8:
cashWithdrawalAmount = validateNonNegativeIntegerInput("[ " + langOutputs[30][currentLanguange]);
isCashWithdrawalValid = true;
break;
default:
defaultCaseMenu();
EnterForContinue();
isCashWithdrawalValid = false;
}
ClearScreen();
// Conversion of output value to Rupiah
String cashWithdrawalRupiah = currencyFormat.format(cashWithdrawalAmount);
if (isCashWithdrawalValid) {
System.out.println(
"[===================================================================================================]\n"+
"[ " + langOutputs[31][currentLanguange] + cashWithdrawalRupiah + " ? ");
if (UserConfirmation()) {
if (PinValidation()) {
if (cashWithdrawalAmount < userBalance) {
if (cashWithdrawalAmount <= MAX_AMOUNT_TRANSACTION && cashWithdrawalAmount >= MIN_AMOUNT_TRANSACTION) {
userBalance -= cashWithdrawalAmount;
// Conversion of output value to Rupiah
String userBalanceRupiah = currencyFormat.format(userBalance);
viewTransactionSuccess();
System.out.println("[ " + langOutputs[26][currentLanguange] + userBalanceRupiah);
// Recording transaction history
transactionHistoryList.add(new ArrayList<>(List.of(langOutputs[52][currentLanguange],
adjustNumCharHistory(cashWithdrawalRupiah), formattedLocalTime(),
formattedLocalDate())));
recordTransactionHistory();