/*
* To change this template, choose Tools | Templates^
* and open the template in the editor.
*/f
package bank;
/**
*
* @author
*/
import javax.swing.*;
import java.io.*;
public class Bank {
public static void main(String[] args) {
BufferedReader input = new BufferedReader (new InputStreamReader (System.in));{
int pin = 1234, saldo, rek, p_voucher;
int proses, byr, konfirmasi_ganti, gantiPIN;
int jumlah_transfer, no_rekening, penarikan;
int option, hapus, voucher, nominal;
int sisaPIN=0;
int opsi,beli; String no_HP;
int transfer, PILIH, info;
int kartu, ec,tr, ganti;
saldo=23458000;
no_rekening=63240023;
jumlah_transfer=0;
penarikan=0;
kartu=857497759;
rek =62342839;
String pilihan=JOptionPane.showInputDialog("PILIH BAHASA : \n\n"
+ " 1. INDONESIA\n"
+ " 2. ENGLISH\n\n");
int menu = Integer.parseInt(pilihan);
switch(menu){
case 1:
try{
System.out.println("SELAMAT DATANG DI ATM BTN");
System.out.println("-------------------------------------------------");
System.out.println("");
System.out.println("SILAHKAN INPUTKAN PIN ANDA");
System.out.print("-> ");
pin = Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
for (int i=1; i<=2; i++){
if(pin==1234){
do{
System.out.println("\n=================================================");
System.out.println("MENU TRANSAKSI ANDA");
System.out.println("A/n ILMA NURDINI MR");
System.out.println("=================================================");
System.out.println("SILAHKAN PILIH JENIS PENARIKAN");
System.out.println("-> 1. 100.000");
System.out.println("-> 2. 300.000");
System.out.println("-> 3. 500.000");
System.out.println("-> 4. 1.000.000");
System.out.println("-> 5. 1.500.000");
System.out.println("-> 6. TRANSAKSI LAINNYA");
System.out.println("=================================================");
System.out.print("Opsi : ");
option=Integer.parseInt(input.readLine());
System.out.println("-------------------------");
switch(option){
case 1:
System.out.println("=================================================\n");
System.out.println("Silahkan Ambil Uang, Resi dan ATM Menyusul");
System.out.println("Terimakasih Telah Menggunakan ATM BTN");
System.out.println("\n=================================================");
break;
case 2:
System.out.println("=================================================\n");
System.out.println("Silahkan Ambil Uang, Resi dan ATM Menyusul");
System.out.println("Terimakasih Telah Menggunakan ATM BTN");
System.out.println("\n=================================================");
break;
case 3:
System.out.println("=================================================\n");
System.out.println("Silahkan Ambil Uang, Resi dan ATM Menyusul");
System.out.println("Terimakasih Telah Menggunakan ATM BTN");
System.out.println("\n=================================================");
break;
case 4:
System.out.println("=================================================\n");
System.out.println("Silahkan Ambil Uang, Resi dan ATM Menyusul");
System.out.println("Terimakasih Telah Menggunakan ATM BTN");
System.out.println("\n=================================================");
break;
case 5:
System.out.println("=================================================\n");
System.out.println("Silahkan Ambil Uang, Resi dan ATM Menyusul");
System.out.println("Terimakasih Telah Menggunakan ATM BTN");
System.out.println("\n=================================================");
break;
case 6:
System.out.println("-> 1. TRANSFER");
System.out.println("-> 2. REKENING KORAN");
System.out.println("-> 3. PEMBAYARAN");
System.out.println("-> 4. PEMBELIAN");
System.out.println("-> 5. INFORMASI SALDO");
System.out.println("-> 6. TARIK TUNAI");
System.out.println("-> 7. GANTI PIN");
System.out.println("-> 8. REGISTRASI E-CHANNEL");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
opsi= Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (opsi){
case 1:
System.out.println("1. TRANSFER ANTAR REKENING BTN");
System.out.println("2. TRANSFER KE REKENING BANK LAIN ");
System.out.print("Opsi : ");
transfer=Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (transfer){
case 1:
System.out.println("=================================================");
System.out.println("TRANSFER ANTAR REKENING BTN");
System.out.println("=================================================");
System.out.print("SILAHKAN MASUKKAN NOMOR REKENING TUJUAN : ");
no_rekening= Integer.parseInt(input.readLine());
System.out.print("SILAHKAN MASUKKAN JUMLAH UANG UNTUK TRANSFER : ");
jumlah_transfer= Integer.parseInt(input.readLine());
System.out.println("SILAHKAN PILIH TIPE REKENING UNTUK TRANSFER");
System.out.println("-> 1. TABUNGAN");
System.out.println("-> 2. GIRO");
System.out.print("Opsi : ");
PILIH=Integer.parseInt(input.readLine());
switch (PILIH){
case 1: System.out.println("TRANSFER DENGAN TABUNGAN");
break;
case 2: System.out.println("TRANSFER DENGAN GIRO");
break;
}
for (int j=1; j<=1; j++){
System.out.print("PIN ANDA : ");
pin = Integer.parseInt(input.readLine());
}
if (pin==1234){
System.out.println(">PIN MATCH : OK ");
}else {
System.out.println("> PIN NOT MATCH. Transaksi Batal");
}
if(jumlah_transfer>=25000 && saldo>=100000){
System.out.println("> SALDO : OK");
}else {
System.out.println("--> SALDO TIDAK CUKUP UNTUK TRANSFER. Transaksi Gagal");
}
if (no_rekening == 63240023){
System.out.println("-> No Rekening = "+ no_rekening);
System.out.println("-> a/n = Roro Inda Melani");
System.out.println("-> Jumlah Transfer = "+jumlah_transfer);
System.out.println("TRANSAKSI BERHASIL !");
}else{
System.out.println("TIDAK DAPAT MEMPROSES JUMLAH UANG ATAU DENOMINASI YANG ANDA MASUKKAN SALAH");
saldo=saldo-jumlah_transfer;
break;
}break;
case 2: System.out.println("=================================================");
System.out.println("TRANSFER KE BANK LAIN ");
System.out.println("=================================================");
System.out.print("Masukkan 3 digit kode Bank Lain : ");
tr=Integer.parseInt(input.readLine());
System.out.print("Mssukkan Nomor Rekening Tujuan : ");
no_rekening=Integer.parseInt(input.readLine());
System.out.print("SILAHKAN MASUKKAN JUMLAH UANG UNTUK TRANSFER : ");
jumlah_transfer= Integer.parseInt(input.readLine());
System.out.println("SILAHKAN PILIH TIPE REKENING UNTUK TRANSFER");
System.out.println("-> 1. TABUNGAN");
System.out.println("-> 2. GIRO");
System.out.print("Opsi : ");
PILIH=Integer.parseInt(input.readLine());
switch (PILIH){
case 1: System.out.println("TRANSFER DENGAN TABUNGAN");
break;
case 2: System.out.println("TRANSFER DENGAN GIRO");
break;
}
for (int j=1; j<=1; j++){
System.out.print("PIN ANDA : ");
pin = Integer.parseInt(input.readLine());
}
if (pin==1234){
System.out.println(">PIN MATCH : OK ");
}else {
System.out.println("> PIN NOT MATCH. Transaksi Batal");
}
if(jumlah_transfer>=25000 && saldo>=100000){
System.out.println("> SALDO : OK");
}else {
System.out.println("--> SALDO TIDAK CUKUP UNTUK TRANSFER. Transaksi Gagal");
}
if (no_rekening == 62342839){
System.out.println("-> No Rekening = "+ rek);
System.out.println("-> a/n = Roro Inda Melani");
System.out.println("-> Jumlah Transfer = "+jumlah_transfer);
System.out.println("TRANSAKSI BERHASIL !");
}else{
System.out.println("TIDAK DAPAT MEMPROSES JUMLAH UANG ATAU DENOMINASI YANG ANDA MASUKKAN SALAH");
saldo=saldo-jumlah_transfer;
break;}
}break;
case 2: System.out.println("Transaksi Proses.");
break;
case 3:
System.out.println("SILAHKAN PILIH JENIS TRANSAKSI PEMBAYARAN ANDA");
System.out.println(">> 1. TELEPON / HP");
System.out.println(">> 2. Multipayment");
System.out.println(">> 3. PDAM ");
System.out.println(">> 4. GAS");
System.out.println(">> 5. KPR");
System.out.println(">> 6. LISTRIK");
System.out.println(">> 7. KARTU KREDIT");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
byr=Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch(byr){
case 1: System.out.println("Pembayaran Telepon / HP. Transaksi Proses.");
break;
case 2: System.out.println("Pembayaran Multipayment. Transaksi Proses.");
break;
case 3: System.out.println("Pembayaran PDAM. Transaksi Proses.");
break;
case 4: System.out.println("Pembayaran GAS. Transaksi Proses.");
break;
case 5: System.out.println("Pembayaran KPR. Transaksi Proses.");
break;
case 6: System.out.println("Pembayaran Listrik. Transaksi Proses.");
break;
case 7 : System.out.println("Pembayaran Kartu Kredit. Transaksi Proses.");
break;
}break;
case 4: System.out.println("=================================================");
System.out.println("PEMBELIAN");
System.out.println("=================================================");
System.out.println("SILAHKAN PILIH JENIS PEMBELIAN");
System.out.println(">> 1. VOUCHER");
System.out.println(">> 2. PLN PREPAID");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
beli=Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (beli){
case 1: System.out.println("Pembelian Voucher ");
System.out.println(">> 1. Pilih Voucher ");
System.out.println(">> 2. Pilih Nominal Voucher");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
p_voucher=Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (p_voucher){
case 1: System.out.println("Voucher ");
System.out.println("1. Telkomsel");
System.out.println("2. Smartfren");
System.out.println("3. Flexi");
System.out.println("4. XL/ AXIS");
System.out.println("5. ESIA");
System.out.println("6. Mentari");
System.out.println("7. IM3");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
voucher = Integer.parseInt(input.readLine());
switch (voucher){
case 1 : System.out.println("Vucher Telkomsel ");
break;
case 2 : System.out.println("Voucher Smartfren ");
break;
case 3: System.out.println("Voucher Flexi");
break;
case 4: System.out.println("Voucher XL / AXIS");
break;
case 5: System.out.println("Voucher ESIA");
break;
case 6: System.out.println("Voucher Mentari ");
break;
case 7 :
System.out.println("Voucher IM3");
break;
}
break;
case 2: System.out.println("PILIH NOMINAL");
System.out.println("1. Rp. 25.000");
System.out.println("2. Rp. 50.000");
System.out.println("3. Rp. 100.000");
System.out.println("4. Rp. 150.000");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
nominal = Integer.parseInt(input.readLine());
switch (nominal){
case 1: System.out.println("Nominal Voucher 25.000");
break;
case 2: System.out.println("Nominal Voucher 50.000");
break;
case 3: System.out.println("Nominal Voucher 100.000");
break;
case 4: System.out.println("Nominal Voucher 150.000");
break;
}
}
System.out.println("-------------------------------------------------");
break;
case 2: System.out.println("Pembelian PLN Prepaid. Transaksi Proses");
break;
}
break;
case 5: System.out.println("=================================================");
System.out.println("SALDO ANDA SAAT INI : "+saldo);
System.out.println("=================================================");
System.out.println("SILAHKAN PILIH TIPE REKENING UNTUK INFORMASI SALDO");
System.out.println("-> 1. GIRO");
System.out.println("-> 2. TABUNGAN");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
info= Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (info){
case 1: System.out.println("Informasi saldo Giro");
System.out.println("NO. KARTU : "+kartu);
System.out.println("NO. REK : "+no_rekening);
System.out.println("Jumlah : Rp. "+ saldo);
break;
case 2: System.out.println("Informasi Saldo Tabungan");
System.out.println("NO. KARTU : "+kartu);
System.out.println("NO. REK : "+no_rekening);
System.out.println("Jumlah : Rp. "+ saldo);
break;
}
break;
case 6: System.out.println("=================================================");
System.out.println("TARIK TUNAI");
System.out.println("=================================================");
System.out.print("Masukkan Jumlah Uang >> ");
penarikan = Integer.parseInt(input.readLine());
System.out.println("Saldo Awal : "+saldo);
System.out.println("Penarikan : "+penarikan );
saldo = saldo-penarikan;
System.out.println("Saldo Akhir : "+saldo);
for (int k=1; k<=1; k++){
System.out.print("PIN ANDA : ");
pin= Integer.parseInt(input.readLine());
}
if (pin==1234){
System.out.println("-> PIN MATCH ");
}else {
System.out.println("-> PIN NOT MATCH. TRANSAKSI BATAL ");
}
if (penarikan >= (saldo-50000)){
System.out.println("-> SALDO TIDAK CUKUP : TRANSAKSI GAGAL !");
}else { System.out.println("TRANSAKSI BERHASIL ");
}
break;
case 7 :
System.out.println("=================================================");
System.out.println("GANTI PIN");
System.out.println("=================================================");
System.out.println(">> 1. GANTI PIN");
System.out.println("-------------------------------------------------");
System.out.print("opsi : ");
ganti = Integer.parseInt(input.readLine());
switch (ganti){
case 1:
System.out.print("Masukkan PIN Baru Anda : ");
gantiPIN = Integer.parseInt(input.readLine());
System.out.print("Konfirmasi PIN Baru Anda : ");
konfirmasi_ganti = Integer.parseInt(input.readLine());
if(gantiPIN==konfirmasi_ganti){
System.out.println("\nPIN Anda Berhasil Diganti\n");
}else {
System.out.println("\nKonfirmasi PIN Anda salah. Silahkan Ulangi Kembali\n");
}break;
}
break;
case 8: System.out.println("=================================================");
System.out.println("REGISTRASI E-CHANNEL");
System.out.println("=================================================");
System.out.println(">> 1. SMS BANKING");
System.out.println(">> 2. Hapus Keanggotaan ");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
ec= Integer.parseInt(input.readLine());
switch(ec){
case 1: System.out.println("Pendaftaran SMS Banking");
System.out.print("Masukkan No. HP Anda : ");
no_HP=(input.readLine());
System.out.println("=================================================");
System.out.println("Registrasi dengan Nomor "+no_HP+" Berhasil ");
break;
case 2: System.out.println("\nHapus Keanggotaan ");
System.out.println("-------------------------------------------------");
System.out.println("Anda Yakin Mengahus keanggotaan Anda? ");
System.out.println("ketik 1 jika iya"
+ "\nketik 0 jika tidak");
System.out.println("-------------------------------------------------");
System.out.print("Opsi >> ");
hapus=Integer.parseInt(input.readLine());
switch (hapus){
case 1: System.out.println("Anda Telah Tergapus dari Keanggotaan SMS Banking ");
break;
default : System.out.println("Batal Menghapus Keanggotaan ");
break;
}
System.out.println("=================================================");
}break;
default: System.out.println("PILIHAN MENU TIDAK ADA");
}
}
System.out.println("\nApakah Anda Ingin Melakukan Transaksi Lainnya? "
+ "\ntekan 1 jika iya"
+ "\ntekan 0 jika tidak");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
String a= String.valueOf(input);
a=input.readLine();
proses=Integer.parseInt(a);
}
while (proses==1);
System.out.println("\nTERIMA KASIH TELAH MENGGUNAKAN ATM BTN");
break;
}
else{
sisaPIN=3-i;
System.out.println("\nPIN SALAH");
System.out.println(sisaPIN+ " Kesempatan lagi.");
System.out.println("SILAHKAN INPUTKAN KEMBALI PIN ANDA");
System.out.print("-> ");
pin = Integer.parseInt(input.readLine());
if(i>=2){
System.out.println("\nMaaf, Untuk Sementara Anda Tidak Bisa Mengakses ATM. \nSilahkan Coba Lagi Nanti");
}
}
}
}catch(IOException e) {
System.out.println("ERROR!!!");
}
catch(NumberFormatException e){
System.out.println("PIN ANDA SALAH");
}
break;
case 2:
try{
System.out.println("WELCOME TO ATM BTN");
System.out.println("-------------------------------------------------");
System.out.println("");
System.out.println("INPUT YOUR PIN HERE ");
System.out.println("-> ");
pin = Integer.parseInt(input.readLine());
for (int i=1; i<=2; i++){
if(pin==1234){
do{
System.out.println("\n=================================================");
System.out.println("YOUR TRANSACTION MENU");
System.out.println("A/n ILMA NURDINI MR\n");
System.out.println("=================================================");
System.out.println("-> 1. 1.500.000");
System.out.println("-> 2. 1.000.000");
System.out.println("-> 3. 500.000");
System.out.println("-> 4. 300.000");
System.out.println("-> 5. 100.000");
System.out.println("-> 6. OTHER TRANSACTION");
System.out.println("=================================================");
System.out.print("OPTION -> ");
option=Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch(option){
case 1:
System.out.println("=================================================\n");
System.out.println("Please Take the Money. ATM come afterward");
System.out.println("Thank you For Using ATM BTN");
System.out.println("\n=================================================");
break;
case 2:
System.out.println("=================================================\n");
System.out.println("Please Take the Money. ATM come afterward");
System.out.println("Thank you For Using ATM BTN");
System.out.println("\n=================================================");
break;
case 3:
System.out.println("=================================================\n");
System.out.println("Please Take the Money. ATM come afterward");
System.out.println("Thank you For Using ATM BTN");
System.out.println("\n=================================================");
break;
case 4:
System.out.println("=================================================\n");
System.out.println("Please Take the Money. ATM come afterward");
System.out.println("Thank you For Using ATM BTN");
System.out.println("\n=================================================");
break;
case 5:
System.out.println("=================================================\n");
System.out.println("Please Take the Money. ATM come afterward");
System.out.println("Thank you For Using ATM BTN");
System.out.println("\n=================================================");
break;
case 6:
System.out.println("-> 1. TRANSFER");
System.out.println("-> 2. REKENING KORAN");
System.out.println("-> 3. PAYMENT");
System.out.println("-> 4. PURCHASE");
System.out.println("-> 5. BALANCE INFOTMATION");
System.out.println("-> 6. WITHDRAW");
System.out.println("-> 7. CHANGE PIN");
System.out.println("-> 8. E-CHANNEL REGISTRATION");
System.out.println("-------------------------------------------------");
System.out.print("Option : ");
opsi= Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (opsi){
case 1:
System.out.println("1. TRANSFER BETWEEN BTN ACCOUNT ");
System.out.println("2. TRANSFER TO ANOTHER BANK ACCOUNT ");
System.out.println("-------------------------------------------------");
System.out.print("Option : ");
transfer=Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (transfer){
case 1:
System.out.println("=================================================");
System.out.println("TRANSFER BETWEEN BTM ACCOUNT");
System.out.println("=================================================");
System.out.print("PLEASE INPUT THE DESTINATION BANK ACCOUNT : ");
no_rekening= Integer.parseInt(input.readLine());
System.out.print("PLEASE INPUT AMOUNT MONEY : ");
jumlah_transfer= Integer.parseInt(input.readLine());
System.out.println("PLEASE CHOOSE THE TYPE OF TRANSFER");
System.out.println("-> 1. SAVINGS");
System.out.println("-> 2. CREDIT TRANSFER\n");
PILIH=Integer.parseInt(input.readLine());
switch (PILIH){
case 1: System.out.println("SAVINGS TRANSFER");
break;
case 2: System.out.println("CREDIT TRANSFER");
}
for (int j=1; j<=1; j++){
System.out.print("YOUR PIN : ");
pin = Integer.parseInt(input.readLine());
}
if (pin==1234){
System.out.println(">PIN MATCH : OK ");
}else {
System.out.println("> PIN NOT MATCH. Transaksi Batal");
}
if(jumlah_transfer>=25000 && saldo>=100000){
System.out.println("> SALDO : OK");
}else {
System.out.println("--> THE BALANCE IS NOT ENOUGH TO DO TRANSFER. TRANSACTION FAILED");
}
if (no_rekening == 63240023){
System.out.println("-> BANK ACCOUNT NUMBER = "+ no_rekening);
System.out.println("-> AS NAME = Roro Inda Melani");
System.out.println("-> AMOUNT TRANSFER = "+jumlah_transfer);
System.out.println("TRANSACTION SUCCESS!");
}else{
System.out.println("CANNOT PROCESS AMOUNT MONEY OR WRONG DENOMINATION");
saldo=saldo-jumlah_transfer;
break;
}
case 2: System.out.println("=================================================");
System.out.println("TRANSFER TO ANOTHER BANK ");
System.out.println("=================================================");
System.out.print("Input 3 digits of Destination Bank : ");
tr=Integer.parseInt(input.readLine());
System.out.print("Input Destination Bank Account Number : ");
rek=Integer.parseInt(input.readLine());System.out.print("SILAHKAN MASUKKAN JUMLAH UANG UNTUK TRANSFER : ");
jumlah_transfer= Integer.parseInt(input.readLine());
System.out.println("SILAHKAN PILIH TIPE REKENING UNTUK TRANSFER");
System.out.println("-> 1. TABUNGAN");
System.out.println("-> 2. GIRO");
System.out.print("Opsi : ");
PILIH=Integer.parseInt(input.readLine());
switch (PILIH){
case 1: System.out.println("TRANSFER DENGAN TABUNGAN");
break;
case 2: System.out.println("TRANSFER DENGAN GIRO");
break;
}
for (int j=1; j<=1; j++){
System.out.print("YOUR PIN : ");
pin = Integer.parseInt(input.readLine());
}
if (pin==1234){
System.out.println(">PIN MATCH : OK ");
}else {
System.out.println("> PIN NOT MATCH. Transaction Failed");
}
if(jumlah_transfer>=25000 && saldo>=100000){
System.out.println("> SALDO : OK");
}else {
System.out.println("--> THE BALANCE IS NOT ENOUGH TO DO TRANSFER. TRANSACTION FAILED");
}
if (no_rekening == 62342839){
System.out.println("-> Bank Account Number = "+ rek);
System.out.println("-> AS NAME = Roro Inda Melani");
System.out.println("-> Amount Transfer = "+jumlah_transfer);
System.out.println("TRANSACTION SUCCESS !");
}else{
System.out.println("CANNOT PROCESS AMOUNT MONEY OR WRONG DENOMINATION");
saldo=saldo-jumlah_transfer;
break;}
}break;
case 2: System.out.println("Transaction is being Process.");
break;
case 3:
System.out.println("PLEASE CHOOSE THE TYPE OF YOUR PAYMENT TRANSACTION");
System.out.println(">> 1. TELEPHONE / HP");
System.out.println(">> 2. Multipayment");
System.out.println(">> 3. PDAM ");
System.out.println(">> 4. GAS");
System.out.println(">> 5. KPR");
System.out.println(">> 6. ELECTRICITY");
System.out.println(">> 7. CREADIT CARD");
System.out.println("-------------------------------------------------");
System.out.print("Option : ");
byr=Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch(byr){
case 1: System.out.println("Telephone / HP Payment. Transaction is being Process");
break;
case 2: System.out.println("Multipayment. Transaction is being Process");
break;
case 3: System.out.println("Pembayaran PDAM. Transaction is being Process");
break;
case 4: System.out.println("GAS Payment. Transaction is being Process");
break;
case 5: System.out.println("KPR Payment. Transaction is being Process");
break;
case 6: System.out.println("Electric Payment. Transaction is being Process");
break;
case 7 : System.out.println("Credit Card Payment. Transaction is being Process");
break;
}break;
case 4: System.out.println("=================================================");
System.out.println("PURCHASE");
System.out.println("=================================================");
System.out.println("CHOOSE THE TYPE PURCHASE");
System.out.println(">> 1. VOUCHER");
System.out.println(">> 2. PLN PREPAID");
System.out.println("-------------------------------------------------");
System.out.print("Option : ");
beli=Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (beli){
case 1: System.out.println("Voucher Purchase");
System.out.println(">> 1. Choose Voucher ");
System.out.println(">> 2. Choose Nominal Voucher");
System.out.println("-------------------------------------------------");
System.out.print("Option : ");
p_voucher=Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (p_voucher){
case 1: System.out.println("Voucher ");
System.out.println("1. Telkomsel");
System.out.println("2. Smartfren");
System.out.println("3. Flexi");
System.out.println("4. XL/ AXIS");
System.out.println("5. ESIA");
System.out.println("6. Mentari");
System.out.println("7. IM3");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
voucher = Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (voucher){
case 1 : System.out.println("Vucher Telkomsel ");
break;
case 2 : System.out.println("Voucher Smartfren ");
break;
case 3: System.out.println("Voucher Flexi");
break;
case 4: System.out.println("Voucher XL / AXIS");
break;
case 5: System.out.println("Voucher ESIA");
break;
case 6: System.out.println("Voucher Mentari ");
break;
case 7 :
System.out.println("Voucher IM3");
break;
}
break;
case 2: System.out.println("Choose NOMINAL");
System.out.println("1. Rp. 25.000");
System.out.println("2. Rp. 50.000");
System.out.println("3. Rp. 100.000");
System.out.println("4. Rp. 150.000");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
nominal = Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (nominal){
case 1: System.out.println("Nominal Voucher 25.000");
break;
case 2: System.out.println("Nominal Voucher 50.000");
break;
case 3: System.out.println("Nominal Voucher 100.000");
break;
case 4: System.out.println("Nominal Voucher 150.000");
break;
}
}
System.out.println("-------------------------------------------------");
break;
case 2: System.out.println("Purchasing PLN Prepaid. Transaction is being process.");
break;
}
break;
case 5: System.out.println("=================================================");
System.out.println("YOUR BALANCE : "+saldo);
System.out.println("=================================================");
System.out.println("PLEASE ENTER THE TYPE OF BANK ACCOUNT FOR BALANCE INFORMATION");
System.out.println("-> 1. CREDIT TRANSFER");
System.out.println("-> 2. SAVINGS");
System.out.println("-------------------------------------------------");
System.out.print("Option : ");
info= Integer.parseInt(input.readLine());
System.out.println("-------------------------------------------------");
switch (info){
case 1: System.out.println("CREDIT TRANSFER INFORMATION");
System.out.println("CARD NUMBER : "+kartu);
System.out.println("BANK AACOUNT NUMBER : "+no_rekening);
System.out.println("AMOUNT : Rp. "+ saldo);
break;
case 2: System.out.println("SAVING BALANCE INFORMATION");
System.out.println("CARD NUMBER : "+kartu);
System.out.println("BANK ACCOUNT NUMBER : "+no_rekening);
System.out.println("AMOUNT : Rp. "+ saldo);
break;
}
break;
case 6: System.out.println("=================================================");
System.out.println("WITHDRAW");
System.out.println("=================================================");
System.out.print("INPUT AMOUNT MONEY >> ");
penarikan = Integer.parseInt(input.readLine());
System.out.println("FIRST BALANCE : "+saldo);
System.out.println("WITHDRAW : "+penarikan );
saldo = saldo-penarikan;
System.out.println("LAST BALANCE : "+saldo);
for (int k=0; k<=1; k++){
System.out.println("YOUR PIN : ");
pin= Integer.parseInt(input.readLine());
}
if (pin==1234){
System.out.println("-> PIN MATCH ");
}else {
System.out.println("-> PIN NOT MATCH. TRANSACTION FAILED ");
}
if (penarikan >= (saldo-50000)){
System.out.println("-> THE BALANCE IS NOT ENOUGH : TRANSACTION FAILED !");
}else { System.out.println("TRANSACTION SUCCESS ");
}
break;
case 7 :
System.out.println("=================================================");
System.out.println("CHANGE PIN");
System.out.println("=================================================");
System.out.println(">> 1. CHANGE PIN");
System.out.println("-------------------------------------------------");
System.out.print("option : ");
ganti = Integer.parseInt(input.readLine());
switch (ganti){
case 1:
System.out.print("PLASE ENTER YOUR NEW PIN : ");
gantiPIN = Integer.parseInt(input.readLine());
System.out.print("CONFIRM YOUR NEW PIN : ");
konfirmasi_ganti = Integer.parseInt(input.readLine());
if(gantiPIN==konfirmasi_ganti){
System.out.println("\nCHANGING SUCCESS\n");
System.out.println("-------------------------------------------------");
}else {
System.out.println("\nYOUR CORFIRMATION PIN IS WRONG. PLEASE TRY AGAIN\n");
System.out.println("-------------------------------------------------");
}break;
}break;
case 8: System.out.println("=================================================");
System.out.println("REGISTRASI E-CHANNEL");
System.out.println("=================================================");
System.out.println(">> 1. SMS BANKING");
System.out.println(">> 2. DELETE MEMBER ");
System.out.println("-------------------------------------------------");
System.out.print("Opsi : ");
ec= Integer.parseInt(input.readLine());
switch(ec){
case 1: System.out.println("SMS Banking Registration");
System.out.print("Please Enter your SIM number : +628");
no_HP=(input.readLine());
System.out.println("=================================================");
System.out.println("Registrasi with number "+ no_HP + "Success");
break;
case 2: System.out.println("\nDelete Member ");
System.out.println("-------------------------------------------------");
System.out.println("Are you sure you want to delete member? ");
System.out.println("Press 1 if yes"
+ "\nPress 0 if No ");
System.out.println("-------------------------------------------------");
System.out.print("Option >> ");
hapus=Integer.parseInt(input.readLine());
switch (hapus){
case 1: System.out.println("YOU HAVE DELETE YOUR MEMBER ACCOUNT");
break;
default : System.out.println("CANCEL DELETE MEMBER ");
break;
}
}break;
default:
System.out.println("NO MENU ");
}
}
System.out.println("\nDo you want to do another transaction? "
+ "\nPress 1 if Yes"
+ "\nPress 0 if No");
System.out.println("-------------------------------------------------");
String a= String.valueOf(input);
a=input.readLine();
proses=Integer.parseInt(a);
}
while (proses==1);
System.out.println("\nThank You For Using ATM BTN");
break;
}
else{
sisaPIN=3-i;
System.out.println("\nWRONG PIN");
System.out.println(sisaPIN+ " CHANCE LEFT.");
System.out.println("PLEASE ENTER YOUR PIN AGAIN ");
System.out.print("-> ");
pin = Integer.parseInt(input.readLine());
if(i>=2){
System.out.println("\nSorry, You cannot Use you ATM For a While, Please Try Again Later");
}
}
}
}catch(IOException e) {
System.out.println("ERROR!!!");
}
catch(NumberFormatException e){
System.out.println("YOUR PIN IS WRONG");
}
break;
}
}
}
}
Tidak ada komentar:
Posting Komentar