#include<iostream>
using
namespace std;
int
check();
int
trans();
int
bank();
int
saldo=10000000,transfer,pil;
string
nomor ;
int main()
{
system("color 1F");
int
pilih;
char
repeat;
{
//saldo_akhir=saldo-transfer;
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"--------------------------------------------------------------------------"<<endl<<endl;
cout<<"silahkan
pilih Menu yang anda inginkan :"<<endl;
cout<<"1.
Transfer
<======"<<endl;
cout<<"2.
informasi Saldo
<======"<<endl<<endl;
cout<<"Masukan
menu pilihan Anda : ";
cin>>pilih;
if(pilih==1)
{
return
bank();
}
if(pilih==2)
{
return check();
}
else
{
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"---------------------------------------------------------------"<<endl<<endl;
cout<<"Pilihan
tidak ada, apakah Anda ingin kembali ke menu utama? [Y/N]";
cin>>repeat;
if(repeat=='Y'||repeat=='y')
{
system("cls");
return main();
}
if(repeat=='N'||repeat=='n')
{
return 0;
}
}
system("pause");
}
}
//
bank
int
bank()
{
system("cls");
char repeat;
int kode;
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"------------------------------------------------------------------"<<endl<<endl;
cout<<"PILIH
BANK TUJUAN TRANSFER YANG ANDA INGINKAN"<<endl;
cout<<"------------------------------------------------------------------"<<endl<<endl;
cout<<"1.
Ke rekening BNI
<===="<<endl;
cout<<"2.
Ke rekening lain
<===="<<endl<<endl;
cout<<"Masukkan
plihan Anda : ";
cin>>pil;
if(pil==1)
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"----------------------------------------"<<endl<<endl;
cout<<"Silahkan masukkan
nomor rekening tujuan transfer Anda"<<endl<<endl;
cin>>nomor;
return trans();
}
if(pil==2)
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"-------------------------------------------------------"<<endl<<endl;
cout<<"Keterangan kode
bank "<<endl;
cout<<"002 : BNI 005 : Danamon"<<endl;
cout<<"006 : Mandiri 451 : BSM"<<endl;
cout<<"007 : Bukopin 200 : BTN
"<<endl;
cout<<"Silahkan masukkan
kode bank tujuan transfer Anda"<<endl<<endl;
cin>>kode;
if(kode==002)
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"-----------------------------------------------------------"<<endl<<endl;
cout<<"Bank
BRI"<<endl<<endl;
cout<<"Silahkan
masukkan nomor rekening tujuan transfer Anda"<<endl<<endl;
cin>>nomor;
return trans();
}
else if(kode==006)
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"----------------------------------------------------------"<<endl<<endl;
cout<<"Bank
Mandiri"<<endl<<endl;
cout<<"Silahkan
masukkan nomor rekening tujuan transfer Anda"<<endl<<endl;
cin>>nomor;
return trans();
}
else if(kode==007)
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"-------------------------------------------------------------"<<endl<<endl;
cout<<"Bank
bukopin"<<endl<<endl;
cout<<"Silahkan
masukkan nomor rekening tujuan transfer Anda"<<endl<<endl;
cin>>nomor;
return trans();
}
else if(kode==005)
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"-------------------------------------------------------------"<<endl<<endl;
cout<<"Bank
Danamon"<<endl<<endl;
cout<<"Silahkan
masukkan nomor rekening tujuan transfer Anda"<<endl<<endl;
cin>>nomor;
return trans();
}
else if(kode==200)
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"----------------------------------------------------------"<<endl<<endl;
cout<<"Bank
BTN"<<endl<<endl;
cout<<"Silahkan
masukkan nomor rekening tujuan transfer Anda"<<endl<<endl;
cin>>nomor;
return trans();
}
else if(kode==451)
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"---------------------------------------------------------------"<<endl<<endl;
cout<<"Bank
BSM"<<endl<<endl;
cout<<"Silahkan
masukkan nomor rekening tujuan transfer Anda"<<endl<<endl;
cin>>nomor;
return trans();
}
}
else
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"--------------------------------------------------------------"<<endl<<endl;
cout<<"Pilihan tidak ada,
apakah Anda ingin mkembali ke menu utama? [Y/N]";
cin>>repeat;
if(repeat=='Y'||repeat=='y')
{
system("cls");
return
bank();
}
if(repeat=='N'||repeat=='n')
{
return 0;
}
}
}
//transfer
int
trans()
{
system("cls");
char
sure,back;
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"-------------------------------------------------------------------------"<<endl<<endl;
cout<<"Masukan
Jumlah transfer : Rp. ";
cin>>transfer;
if(saldo>transfer)
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"-----------------------------------------------------------"<<endl<<endl;
cout<<"Apakah
Anda yakin untuk melakukan transfer sebesar Rp.
"<<transfer<<endl;
cout<<"
ke rekening "<<nomor<<" ? [Y/N]";
cin>>sure;
if(sure=='Y'||sure=='y')
{
system("cls");
saldo=saldo-transfer;
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"-------------------------------------------------------------------"<<endl<<endl;
cout<<"Selamat,
transfer Anda berhasil!"<<endl<<endl;
cout<<"saldo
anda Rp."<<saldo<<endl;
}
}
else
{
system("cls");
cout<<"Maaf,
Saldo Anda tidak mencukupi!"<<endl;
cout<<"Apakah
Anda ingin kembali ke menu awal? [Y/N] : ";
cin>>back;
if(back=='Y'||back=='y')
{
system("cls");
return
main();
}
else
{
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"---------------------------------------------------------------------"<<endl<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<" terima
kasih"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<" silahkan ambil kembali
kartu ATM anda"<<endl;
return
0;
system("pause");
}
}
cout<<endl;
cout<<"------------------------------------------------------------------------------"<<endl;
cout<<"Apakah
Anda ingin melakukan transaksi lainnya?[Y/N] : ";
cin>>back;
if(back=='Y'||back=='y')
{
system("cls");
return
main();
}
else
{
system("cls");
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"------------------------------------------------------------"<<endl<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<" terima
kasih"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"
silahkan ambil kembali kartu ATM anda"<<endl;
system("pause");
return
0;
}
}
//check
saldo
int
check()
{
system("cls");
char confirm;
cout<<" selamat datang di ATM BRI(BANK RAKYAT
INDONESIA)"<<endl;
cout<<"-----------------------------------------------------------------------"<<endl<<endl;
cout<<" Informasi saldo
anda"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"Saldo
: Rp. "<<saldo<<endl<<endl;
cout<<"Apakah
Anda ingin melakukan transaksi lagi?[Y/N] : ";
cin>>confirm;
if(confirm=='Y'||confirm=='y')
{
system("cls");
return main();
}
else
{
system
("cls");
cout<<" selamat
datang di ATM BRI(BANK RAKYAT INDONESIA)"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<" terima
kasih"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"
silahkan ambil kembali kartu ATM anda"<<endl;
system("pause");
return 0;
}
}
FINAL
“ALGORITMA
DAN PEMROGRAMAN”
OLEH
:
AKHMAD KHOERUDIN
F
551 12 020
ISMAIL
ARIEF
F551
12 021
PRODI
S1 TEKNIK NFORMATIKA
JURUSAN
TEKNIK ELEKTRO
FAKULTAS
TEKNIK
UNIVERSITAS
TADULAKO
2013