Advertisement
AldiDwik

Perbankan

Dec 15th, 2020
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.42 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. public class Perbankan {
  5.  
  6. public static String[] nama, jenisKelamin, kewarganegaraan;
  7. public static String[] pilJenis = {"Tabungan Konvensional", "Tabungan Giro", "Tabungan Investasi", "Tabungan TKI"};
  8. public static int[] noRek, randomAngka, saldo, setor, ambil, jenis, tf, norekTujuan, namaTujuan;
  9. public static String[] bankTujuan = {" "};
  10.  
  11. static void inputan() {
  12. Scanner input = new Scanner(System.in);
  13. System.out.print("Masukkan jumlah nasabah : ");
  14. int jmlh = input.nextInt();
  15. nama = new String[jmlh];
  16. jenisKelamin = new String[jmlh];
  17. kewarganegaraan = new String[jmlh];
  18. noRek = new int[jmlh];
  19. saldo = new int[jmlh];
  20. setor = new int[jmlh];
  21. ambil = new int[jmlh];
  22. jenis = new int[jmlh];
  23. bankTujuan = new String[jmlh];
  24. tf = new int[jmlh];
  25. norekTujuan = new int[jmlh];
  26. namaTujuan = new int[jmlh];
  27. System.out.println("");
  28.  
  29. for (int i = 0; i < nama.length; i++) {
  30. System.out.println("Memasukkan Data Nasabah ke " + (i + 1));
  31. Scanner in = new Scanner(System.in);
  32. System.out.print("Masukkan Nama Nasabah : ");
  33. nama[i] = in.nextLine();
  34. System.out.print("Masukkan Jenis Kelamin Nasabah : ");
  35. jenisKelamin[i] = in.nextLine();
  36. System.out.print("Masukkan Kewarganegaraan Nasabah : ");
  37. kewarganegaraan[i] = in.nextLine();
  38. System.out.print("Masukkan Nomor Rekening : ");
  39. noRek[i] = in.nextInt();
  40. System.out.println("------------------------------");
  41. }
  42. }
  43.  
  44. static void cariData() {
  45. Scanner cari = new Scanner(System.in);
  46. System.out.print("Masukkan Nama Nasabah Yang Ingin Dilihat : ");
  47. String dataNasabah = cari.nextLine();
  48.  
  49. for (int i = 0; i < nama.length; i++) {
  50. if (nama[i].equals(dataNasabah)) {
  51. System.out.println("===================DATA NASABAH DITEMUKAN===================");
  52. tampilkanData(i);
  53. break;
  54. }
  55. if (i == nama.length) {
  56. System.out.println("============================================================");
  57. System.out.println("===============DATA NASABAH TIDAK DITEMUKAN=================");
  58. System.out.println("=============SILAHKAN MASUKKAN NAMA YANG BENAR==============");
  59. System.out.println("============================================================");
  60. }
  61. }
  62. }
  63.  
  64. static void pilihTabungan() {
  65. Scanner input = new Scanner(System.in);
  66. System.out.println("===========PILIH JENIS TABUNGAN===========");
  67. System.out.println("1. Tabungan Konvensional");
  68. System.out.println("2. Tabungan Giro");
  69. System.out.println("3. Tabungan Investasi");
  70. System.out.println("4. Tabungan TKI");
  71. for (int i = 0; i < nama.length; i++) {
  72. System.out.print("Masukkan Jenis Tabungan " + nama[i] + " (1/2/3/4) : ");
  73. jenis[i] = input.nextInt();
  74. System.out.println("");
  75. switch (jenis[i]) {
  76. case 1: {
  77.  
  78. System.out.println(pilJenis[0]);
  79. }
  80. break;
  81. case 2: {
  82. System.out.println(pilJenis[1]);
  83. }
  84. break;
  85. case 3: {
  86. System.out.println(pilJenis[2]);
  87. }
  88. break;
  89. case 4: {
  90. System.out.println(pilJenis[3]);
  91. }
  92. break;
  93. }
  94. System.out.println("");
  95. }
  96. }
  97.  
  98. static void tampilkanData(int x) {
  99. System.out.println("Nama Nasabah : " + nama[x] + "\nJenis Kelamin : " + jenisKelamin[x] + "\nKewarganegaraan : " + kewarganegaraan[x] + "\nNomor Rekening : " + noRek[x]);
  100. System.out.println("==========================================================");
  101. }
  102.  
  103. static void cekSaldo() {
  104. for (int i = 0; i < nama.length; i++) {
  105. saldo[i] = (100000 + (int) (Math.random() * 10000000));
  106. System.out.println("Saldo " + nama[i] + " : " + saldo[i]);
  107. }
  108. }
  109.  
  110. static void setorTabungan() {
  111. Scanner sc = new Scanner(System.in);
  112. for (int i = 0; i < nama.length; i++) {
  113. System.out.print("Masukkan Jumlah Uang Yang Akan Disetor Pada Tabungan " + nama[i] + " : ");
  114. setor[i] = sc.nextInt();
  115. saldo[i] += setor[i];
  116. System.out.println("-------Setor Berhasil-------");
  117. System.out.println("Saldo " + nama[i] + " Sekarang : " + saldo[i]);
  118. System.out.println("");
  119. }
  120.  
  121. }
  122.  
  123. static void ambilTabungan() {
  124. Scanner in = new Scanner(System.in);
  125. for (int i = 0; i < nama.length; i++) {
  126. System.out.print("Masukkan Jumlah Uang Yang Akan Diambil Pada Tabungan " + nama[i] + " : ");
  127. ambil[i] = in.nextInt();
  128. saldo[i] -= ambil[i];
  129. System.out.println("-------Berhasil Mengambil Tabungan-------");
  130. System.out.println("Saldo " + nama[i] + " Sekarang : " + saldo[i]);
  131. System.out.println("");
  132. }
  133.  
  134. }
  135.  
  136. static void transfer() {
  137. Scanner sc = new Scanner(System.in);
  138. for (int i = 0; i < nama.length; i++) {
  139. System.out.println("Masukkan Nama Orang Yang Dituju : ");
  140.  
  141. System.out.print("Masukkan Bank Yang Akan Dituju " + nama[i] + " : ");
  142. bankTujuan[i] = sc.next();
  143. System.out.print("Masukkan Nomor Rekening Yang Akan Dituju " + nama[i] + " : ");
  144. norekTujuan[i] = sc.nextInt();
  145. System.out.print("Masukkan Jumlah Uang Yang Akan Ditransfer " + nama[i] + " : ");
  146. tf[i] = sc.nextInt();
  147. saldo[i] -= tf[i];
  148. System.out.println("===========UANG ANDA BERHASIL DI TRANSFER============");
  149. System.out.println("Sisa Saldo " + nama[i] + " : " + saldo[i]);
  150. System.out.println("");
  151. }
  152. }
  153.  
  154. static void cetakLaporan() {
  155. for (int i = 0; i < nama.length; i++) {
  156. System.out.println("===============BANK TOYIB===============");
  157. System.out.println("Nama : " + nama[i]);
  158. System.out.println("Setor : " + setor[i]);
  159. System.out.println("Mengambil : " + ambil[i]);
  160. System.out.println("Transfer : " + tf[i]);
  161. System.out.println("Kepada Bank : " + bankTujuan[i]);
  162. System.out.println("Atas Nama : " + namaTujuan[i]);
  163. System.out.println("Dengan Nomor Rekening : " + norekTujuan[i]);
  164. System.out.println("========================================");
  165. }
  166. }
  167.  
  168. public static void main(String[] args) {
  169. int menu1, menu2;
  170. System.out.println("========================================");
  171. System.out.println("======SELAMAT DATANG DI BANK TOYIB======");
  172. System.out.println("========================================");
  173. do {
  174. System.out.println("");
  175. System.out.println("");
  176. System.out.println("-----MENU BANK TOYIB-----");
  177. System.out.println("FITUR DATA NASABAH");
  178. System.out.println("1. Memasukkan Data Nasabah");
  179. System.out.println("2. Melihat Data Nasabah");
  180. System.out.println("3. Memilih Jenis Tabungan");
  181. System.out.println("4. LANJUT");
  182. System.out.println("");
  183. System.out.println("====================");
  184. System.out.println("");
  185. Scanner pilih = new Scanner(System.in);
  186. System.out.print("Masukkan Pilihan Menu : ");
  187. menu1 = pilih.nextInt();
  188. System.out.println("");
  189. switch (menu1) {
  190. case 1: {
  191. System.out.println("Menu - 1. Memasukkan Data Nasabah");
  192. inputan();
  193. }
  194. break;
  195. case 2: {
  196. System.out.println("Menu - 2. Melihat Data Nasabah");
  197. cariData();
  198. }
  199. break;
  200. case 3: {
  201. System.out.println("Menu - 3. Memilih Jenis Tabungan");
  202. pilihTabungan();
  203. }
  204. break;
  205. }
  206. } while (menu1 > 0 && menu1 < 4);
  207. do {
  208. System.out.println("");
  209. System.out.println("");
  210. System.out.println("-----MENU BANK TOYIB-----");
  211. System.out.println("FITUR TRANSAKSI TABUNGAN");
  212. System.out.println("1. Cek Saldo Nasabah");
  213. System.out.println("2. Setor Tabungan");
  214. System.out.println("3. Ambil Tabungan");
  215. System.out.println("4. Transfer");
  216. System.out.println("5. Cetak Laporan Transaksi Per Nasabah");
  217. System.out.println("6. EXIT");
  218. System.out.println("");
  219. System.out.println("====================");
  220. System.out.println("");
  221. Scanner pilih = new Scanner(System.in);
  222. System.out.print("Masukkan Pilihan Menu (1/2/3/4/5/6) : ");
  223. menu2 = pilih.nextInt();
  224. System.out.println("");
  225. switch (menu2) {
  226. case 1: {
  227. System.out.println("Menu - 1. Cek Saldo Nasabah");
  228. cekSaldo();
  229. }
  230. break;
  231. case 2: {
  232. System.out.println("Menu - 2. Setor Tabungan");
  233. setorTabungan();
  234. }
  235. break;
  236. case 3: {
  237. System.out.println("Menu - 3. Ambil Tabungan");
  238. ambilTabungan();
  239. }
  240. break;
  241. case 4: {
  242. System.out.println("Menu - 4. Transfer");
  243. transfer();
  244. }
  245. break;
  246. case 5: {
  247. System.out.println("Menu - 5. Cetak Laporan Transaksi Per Nasabah");
  248. cetakLaporan();
  249. }
  250. break;
  251. }
  252.  
  253. } while (menu2 > 0 && menu2 < 6);
  254. System.out.println("SIMPAN SEBAGAI BUKTI");
  255. System.out.println("CALL BANK TOYIB : 14027/1200017/(021)21321312");
  256. }
  257. }
  258.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement