Seperti ATM pada umumnya, jika kita salah mmasukkan pin berulang-ulang selama tiga kali, maka atm akan si blokir sementara.. dan jika pin benar maka kita akan masuk ke menu utama pengambilan uang...
langsung aja yah teman-teman ke contoh programya :
- Script Program
- Hasil Compile (saat pin salah)
- Hasil compile (saat pin benar)
Script program disini :
#include <iostream>
#include <string>
#include <conio.h>
#include <windows.h>
#using namespace std;
class ATM {
public():
ATM();
void proses();
private():
int a,i,p;
};
ATM::ATM(){
cout<<"Nama : Dedy Saputra"<<endl;
cout<<"Prodi : Teknik Informatika"<<endl<<endl;
}
void ATM::proses(){
i =1;
a =1400018017;
while (!(i>3)){
cout<<"Silahkan Masukkan PIN ATM anda"<< endl;
cin>> p;
if (p==a){
i =i+5;
}
else{
cout<<"Pin Salah"<<endl<<endl;
i =i+1;}
}
if (i==6){
cout<<endl<<endl;
cout<<"\t\t =============================================="<<endl;
cout<<"\t\t ----------------------------------------------"<<endl;
cout<<"\t\t\t SILAHKAN PILIH TRANSAKSI ANDA"<<endl;
cout<<"\t\t\t Pecahan Rp. 100.000 "<<endl;
cout<<"\t\t ----------------------------------------------"<<endl;
cout<<"\t\t ===============================================\n\n"<<endl<<endl;
cout<<"\t\t\t1.100.000 5.1000.000"<<endl;
cout<<"\t\t\t2.200.000 6.1000.000"<<endl;
cout<<"\t\t\t3.300.000 7.1000.000"<<endl;
cout<<"\t\t\t4.500.000 8.1000.000"<<endl<<endl;
cout<<"\t\t\t\t\t\tTRANSAKSI LAINNYA"<<endl;}
else{
cout<<"\t\t\tMAAF ATM ANDA SEMENTARA KAMI BLOKIR"<<endl;}
}
int main()
{
system("Color 4A");
string sambutan="\t\-------------Selamat Datang di Aplikasi ATM Saya------------- \n";
for (int x=0;x<=sambutan.length();x++){
cout<<sambutan[x];
for (double y=0;y<=9990000;y++){
}}
cout<<endl<<endl;
ATM edet;
edet.proses();
}}}
#include <string>
#include <conio.h>
#include <windows.h>
#using namespace std;
class ATM {
public():
ATM();
void proses();
private():
int a,i,p;
};
ATM::ATM(){
cout<<"Nama : Dedy Saputra"<<endl;
cout<<"Prodi : Teknik Informatika"<<endl<<endl;
}
void ATM::proses(){
i =1;
a =1400018017;
while (!(i>3)){
cout<<"Silahkan Masukkan PIN ATM anda"<< endl;
cin>> p;
if (p==a){
i =i+5;
}
else{
cout<<"Pin Salah"<<endl<<endl;
i =i+1;}
}
if (i==6){
cout<<endl<<endl;
cout<<"\t\t =============================================="<<endl;
cout<<"\t\t ----------------------------------------------"<<endl;
cout<<"\t\t\t SILAHKAN PILIH TRANSAKSI ANDA"<<endl;
cout<<"\t\t\t Pecahan Rp. 100.000 "<<endl;
cout<<"\t\t ----------------------------------------------"<<endl;
cout<<"\t\t ===============================================\n\n"<<endl<<endl;
cout<<"\t\t\t1.100.000 5.1000.000"<<endl;
cout<<"\t\t\t2.200.000 6.1000.000"<<endl;
cout<<"\t\t\t3.300.000 7.1000.000"<<endl;
cout<<"\t\t\t4.500.000 8.1000.000"<<endl<<endl;
cout<<"\t\t\t\t\t\tTRANSAKSI LAINNYA"<<endl;}
else{
cout<<"\t\t\tMAAF ATM ANDA SEMENTARA KAMI BLOKIR"<<endl;}
}
int main()
{
system("Color 4A");
string sambutan="\t\-------------Selamat Datang di Aplikasi ATM Saya------------- \n";
for (int x=0;x<=sambutan.length();x++){
cout<<sambutan[x];
for (double y=0;y<=9990000;y++){
}}
cout<<endl<<endl;
ATM edet;
edet.proses();
}}}
Semoga bermanfaat buat teman-teman semua.. :)
Salam Anak IT (y)
0 Response to "Program ATM || Dev C++"
Post a Comment