Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Perbankan {
- public static String[] nama, jenisKelamin, kewarganegaraan;
- public static String[] pilJenis = {"Tabungan Konvensional", "Tabungan Giro", "Tabungan Investasi", "Tabungan TKI"};
- public static int[] noRek, randomAngka, saldo, setor, ambil, jenis, tf, norekTujuan, namaTujuan;
- public static String[] bankTujuan = {" "};
- static void inputan() {
- Scanner input = new Scanner(System.in);
- System.out.print("Masukkan jumlah nasabah : ");
- int jmlh = input.nextInt();
- nama = new String[jmlh];
- jenisKelamin = new String[jmlh];
- kewarganegaraan = new String[jmlh];
- noRek = new int[jmlh];
- saldo = new int[jmlh];
- setor = new int[jmlh];
- ambil = new int[jmlh];
- jenis = new int[jmlh];
- bankTujuan = new String[jmlh];
- tf = new int[jmlh];
- norekTujuan = new int[jmlh];
- namaTujuan = new int[jmlh];
- System.out.println("");
- for (int i = 0; i < nama.length; i++) {
- System.out.println("Memasukkan Data Nasabah ke " + (i + 1));
- Scanner in = new Scanner(System.in);
- System.out.print("Masukkan Nama Nasabah : ");
- nama[i] = in.nextLine();
- System.out.print("Masukkan Jenis Kelamin Nasabah : ");
- jenisKelamin[i] = in.nextLine();
- System.out.print("Masukkan Kewarganegaraan Nasabah : ");
- kewarganegaraan[i] = in.nextLine();
- System.out.print("Masukkan Nomor Rekening : ");
- noRek[i] = in.nextInt();
- System.out.println("------------------------------");
- }
- }
- static void cariData() {
- Scanner cari = new Scanner(System.in);
- System.out.print("Masukkan Nama Nasabah Yang Ingin Dilihat : ");
- String dataNasabah = cari.nextLine();
- for (int i = 0; i < nama.length; i++) {
- if (nama[i].equals(dataNasabah)) {
- System.out.println("===================DATA NASABAH DITEMUKAN===================");
- tampilkanData(i);
- break;
- }
- if (i == nama.length) {
- System.out.println("============================================================");
- System.out.println("===============DATA NASABAH TIDAK DITEMUKAN=================");
- System.out.println("=============SILAHKAN MASUKKAN NAMA YANG BENAR==============");
- System.out.println("============================================================");
- }
- }
- }
- static void pilihTabungan() {
- Scanner input = new Scanner(System.in);
- System.out.println("===========PILIH JENIS TABUNGAN===========");
- System.out.println("1. Tabungan Konvensional");
- System.out.println("2. Tabungan Giro");
- System.out.println("3. Tabungan Investasi");
- System.out.println("4. Tabungan TKI");
- for (int i = 0; i < nama.length; i++) {
- System.out.print("Masukkan Jenis Tabungan " + nama[i] + " (1/2/3/4) : ");
- jenis[i] = input.nextInt();
- System.out.println("");
- switch (jenis[i]) {
- case 1: {
- System.out.println(pilJenis[0]);
- }
- break;
- case 2: {
- System.out.println(pilJenis[1]);
- }
- break;
- case 3: {
- System.out.println(pilJenis[2]);
- }
- break;
- case 4: {
- System.out.println(pilJenis[3]);
- }
- break;
- }
- System.out.println("");
- }
- }
- static void tampilkanData(int x) {
- System.out.println("Nama Nasabah : " + nama[x] + "\nJenis Kelamin : " + jenisKelamin[x] + "\nKewarganegaraan : " + kewarganegaraan[x] + "\nNomor Rekening : " + noRek[x]);
- System.out.println("==========================================================");
- }
- static void cekSaldo() {
- for (int i = 0; i < nama.length; i++) {
- saldo[i] = (100000 + (int) (Math.random() * 10000000));
- System.out.println("Saldo " + nama[i] + " : " + saldo[i]);
- }
- }
- static void setorTabungan() {
- Scanner sc = new Scanner(System.in);
- for (int i = 0; i < nama.length; i++) {
- System.out.print("Masukkan Jumlah Uang Yang Akan Disetor Pada Tabungan " + nama[i] + " : ");
- setor[i] = sc.nextInt();
- saldo[i] += setor[i];
- System.out.println("-------Setor Berhasil-------");
- System.out.println("Saldo " + nama[i] + " Sekarang : " + saldo[i]);
- System.out.println("");
- }
- }
- static void ambilTabungan() {
- Scanner in = new Scanner(System.in);
- for (int i = 0; i < nama.length; i++) {
- System.out.print("Masukkan Jumlah Uang Yang Akan Diambil Pada Tabungan " + nama[i] + " : ");
- ambil[i] = in.nextInt();
- saldo[i] -= ambil[i];
- System.out.println("-------Berhasil Mengambil Tabungan-------");
- System.out.println("Saldo " + nama[i] + " Sekarang : " + saldo[i]);
- System.out.println("");
- }
- }
- static void transfer() {
- Scanner sc = new Scanner(System.in);
- for (int i = 0; i < nama.length; i++) {
- System.out.println("Masukkan Nama Orang Yang Dituju : ");
- System.out.print("Masukkan Bank Yang Akan Dituju " + nama[i] + " : ");
- bankTujuan[i] = sc.next();
- System.out.print("Masukkan Nomor Rekening Yang Akan Dituju " + nama[i] + " : ");
- norekTujuan[i] = sc.nextInt();
- System.out.print("Masukkan Jumlah Uang Yang Akan Ditransfer " + nama[i] + " : ");
- tf[i] = sc.nextInt();
- saldo[i] -= tf[i];
- System.out.println("===========UANG ANDA BERHASIL DI TRANSFER============");
- System.out.println("Sisa Saldo " + nama[i] + " : " + saldo[i]);
- System.out.println("");
- }
- }
- static void cetakLaporan() {
- for (int i = 0; i < nama.length; i++) {
- System.out.println("===============BANK TOYIB===============");
- System.out.println("Nama : " + nama[i]);
- System.out.println("Setor : " + setor[i]);
- System.out.println("Mengambil : " + ambil[i]);
- System.out.println("Transfer : " + tf[i]);
- System.out.println("Kepada Bank : " + bankTujuan[i]);
- System.out.println("Atas Nama : " + namaTujuan[i]);
- System.out.println("Dengan Nomor Rekening : " + norekTujuan[i]);
- System.out.println("========================================");
- }
- }
- public static void main(String[] args) {
- int menu1, menu2;
- System.out.println("========================================");
- System.out.println("======SELAMAT DATANG DI BANK TOYIB======");
- System.out.println("========================================");
- do {
- System.out.println("");
- System.out.println("");
- System.out.println("-----MENU BANK TOYIB-----");
- System.out.println("FITUR DATA NASABAH");
- System.out.println("1. Memasukkan Data Nasabah");
- System.out.println("2. Melihat Data Nasabah");
- System.out.println("3. Memilih Jenis Tabungan");
- System.out.println("4. LANJUT");
- System.out.println("");
- System.out.println("====================");
- System.out.println("");
- Scanner pilih = new Scanner(System.in);
- System.out.print("Masukkan Pilihan Menu : ");
- menu1 = pilih.nextInt();
- System.out.println("");
- switch (menu1) {
- case 1: {
- System.out.println("Menu - 1. Memasukkan Data Nasabah");
- inputan();
- }
- break;
- case 2: {
- System.out.println("Menu - 2. Melihat Data Nasabah");
- cariData();
- }
- break;
- case 3: {
- System.out.println("Menu - 3. Memilih Jenis Tabungan");
- pilihTabungan();
- }
- break;
- }
- } while (menu1 > 0 && menu1 < 4);
- do {
- System.out.println("");
- System.out.println("");
- System.out.println("-----MENU BANK TOYIB-----");
- System.out.println("FITUR TRANSAKSI TABUNGAN");
- System.out.println("1. Cek Saldo Nasabah");
- System.out.println("2. Setor Tabungan");
- System.out.println("3. Ambil Tabungan");
- System.out.println("4. Transfer");
- System.out.println("5. Cetak Laporan Transaksi Per Nasabah");
- System.out.println("6. EXIT");
- System.out.println("");
- System.out.println("====================");
- System.out.println("");
- Scanner pilih = new Scanner(System.in);
- System.out.print("Masukkan Pilihan Menu (1/2/3/4/5/6) : ");
- menu2 = pilih.nextInt();
- System.out.println("");
- switch (menu2) {
- case 1: {
- System.out.println("Menu - 1. Cek Saldo Nasabah");
- cekSaldo();
- }
- break;
- case 2: {
- System.out.println("Menu - 2. Setor Tabungan");
- setorTabungan();
- }
- break;
- case 3: {
- System.out.println("Menu - 3. Ambil Tabungan");
- ambilTabungan();
- }
- break;
- case 4: {
- System.out.println("Menu - 4. Transfer");
- transfer();
- }
- break;
- case 5: {
- System.out.println("Menu - 5. Cetak Laporan Transaksi Per Nasabah");
- cetakLaporan();
- }
- break;
- }
- } while (menu2 > 0 && menu2 < 6);
- System.out.println("SIMPAN SEBAGAI BUKTI");
- System.out.println("CALL BANK TOYIB : 14027/1200017/(021)21321312");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement