SOURCE CODE :
#include<iostream.h>
int main()
{
int password;
for (int i=0;i<3;i++)
{cout <<"MASUKKAN PASSWORD:\n";
cin>>password;
if (password==123456)
{cout<<"MESIN ATM BEKERJA!!!\n";
double balance = 10000;
double withdraw, deposit;
int option;
cout<<"\n";
cout<<" *** ATM ***\n";
cout<<"*** MESIN ATM***"<<endl;
cout<<"Pilih Transaksi yang akan di lakukan >>> \n";
cout<<"\n";
cout<<"[1] Informasi Saldo \n"
<<"[2] Penarikan Tunai \n"
<<"[3] Setoran \n"
<<"[4] Keluar \n"
<<"\n"
<<"Enter Option:";
cin>>option;
switch(option)
{
case 1:
cout<<"\n Informasi Saldo ; \n";
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"\n Saldo Kamu Sekarang RP "<<balance<<endl;
continue;
case 2:
cout<<"\n Penarikan Tunai ; \n";
cout<<"Masukkan yang akan anda pinjam: RP ";
cin>>withdraw;
balance = balance - withdraw;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"Penarikan kamu RP "<<withdraw<<endl;
cout<<" Saldo Kamu sekarang RP"<<balance<<endl;
continue;
case 3:
cout<<"\n Setoran ; \n";
cout<<"Masukkan Setoran kamu RP ";
cin>>deposit;
balance = balance + deposit;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<" Setoran Kamu RP "<<deposit<<endl;
cout<<" Saldo Kamu sekarang RP"<<balance<<endl;
continue;
case 4:
cout<<"\n GOOD BYE \n";
break;
default:
cout<<"\n That is an invalid option \n";
}
break;
}
else
cout<<"\t\t PASSWORD ANDA SALAH !!!!!! \n\n";}
return 0;
}//
PRINTSCREENNYA :
program cupu
BalasHapuska.... bisa di buat lebih sederhana lagi ga ka?
BalasHapus