Mat Khojna
Mat Khojna
Mat Khojna
PROJECT WORK
: DEBSHILPI PATRA
: 12 ‘A2’
: 2019-20
:
: DAV PUBLIC SCHOOL, BISTUPUR
INDEX
S.No. TOPic Page
1. CERTIFICATE 2
2. INTRODUCTION 3
3. MENU TREE 4
4. SYSTEM 5
REQUIREMENTS
5. SOURCE CODE 6 - 18
7. BIBLIOGRAPHY 22
1
CERTIFICATE
This is to certify that
Master DEBSHILPI PATRA,
AISSCE Roll No have
successfully completed this
project of “ATM”, for the
subject of Computer
Science (OLD), subject code
283 in the academic year
2019-20 under the guidance
of SIR TANMOY PAUL.
2
INTRODUCTION
3
MENU TREE
4
SYSTEM REQUIREMENTS
HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS
5
SOURCE CODE
#include<fstream.h> //Declares the C++ stream classes that support file input and output.
char n[500];
char a[5][500];
double b;
};
char n[200];
void home(); //This function handles the main page after an account is opened
public:
void start(); //This is the first page to ask from user whether to log in, create account or exit
};
6
void bank::start()
repeat:
char a;
clrscr();
cout<<" ATM\n";
cout<<" =======\n\n";
cout<<"________________________________________________________________________________\n";
a=getche();
if(a<'1'||a>'3')
getch();
goto repeat;
if(a=='1')
if(a=='2')
if(a=='3')
void bank::login()
prof p;
char zz[500];
clrscr();
7
cout<<" ATM\n";
cout<<" =======\n\n";
cout<<" HELLO I YOUR ATM ASSISTANT WILL BE GUIDING YOU DURING LOG-IN\n";
cout<<"________________________________________________________________________________\n";
cout<<"\n\n";
ifstream fi("PROFILE.DAT",ios::binary);
while(fi.read((char *)&p,sizeof(p)))
if(!strcmp(n,p.n))
getch();
z:
cout<<"PASSWORD : ";
char b[1000],c;
int i=0;
b[i]=getche();
c=b[i];
if(b[i]==13)
break;
else if(b[i]==8&&i>=0)
if(i>0)
b[--i]='\0';
gotoxy(i+12,10);
cout<<" ";
8
gotoxy(i+12,10);
i--;
delay(150);
if(c!=8)
gotoxy(12+i++,10);
cout<<"*";
else
gotoxy(13+i++,10);
b[i]='\0';
if(strcmp(b,p.a[4]))
cout<<"\nINCORRECT PASSWORD!\n\n\n\n";
getch();
fi.close();
void bank::create()
double ab;
char c[500],cc[500];
prof p;
clrscr();
cout<<" ATM\n";
9
cout<<" =======\n\n";
cout<<" HELLO I YOUR ATM ASSISTANT WILL BE GUIDING YOU WHILE CREATING YOUR ACCOUNT\n";
cout<<"________________________________________________________________________________\n";
cout<<endl<<endl;
ifstream fi("PROFILE.DAT",ios::binary);
while(fi.read((char *)&p,sizeof(p)))
if(!strcmp(n,p.n))
getch();
strcpy(p.n,n);
cout<<endl;
r:
if(ab<5000) //checks for the validity of amount to be deposited during account creation
getch();
clrscr();
10
cout<<" ATM\n";
cout<<" =======\n\n";
cout<<" HELLO I YOUR ATM ASSISTANT WILL BE GUIDING YOU WHILE CREATING YOUR ACCOUNT\n";
cout<<"________________________________________________________________________________\n";
cout<<endl<<endl;
//takes input of all profile details if deposited amount was less than 5000
cout<<"USERNAME : "<<n<<endl;
cout<<"PASSWORD : "<<p.a[4]<<endl;
cout<<endl;
cout<<"NAME : "<<p.a[0]<<endl;
cout<<"ADDRESS : "<<p.a[1]<<endl;
cout<<"EMAIL ID : "<<p.a[2]<<endl;
goto r; //goto r to re-deposit amount if amount deposited was less than 5000
p.b=ab;
fi.close();
ofstream fo("PROFILE.DAT",ios::binary|ios::app);
fo.write((char *)&p,sizeof(p));
getch();
fo.close();
void bank::deposit()
prof p;
double z;
11
ifstream fi("PROFILE.DAT",ios::binary);
ofstream fo("temp.dat",ios::binary);
while(fi.read((char *)&p,sizeof(p)))
if(!strcmp(n,p.n))
r:
clrscr();
cout<<" ATM\n";
cout<<" =======\n\n";
cout<<"_______________________________________________________________________________\n\n\
n";
cout<<"------------------------------------\n";
cout<<"------------------------------------\n\n";
cin>>z;
cout<<"INVALID AMOUNT!\n";
getch();
p.b+=z;
cout<<"\n------------------------------------\n";
cout<<"------------------------------------\n\n";
12
cout<<"CONGATULATIONS! YOU HAVE SUCCESSFULLY DEPOSITED MONEY INTO YOUR ACCOUNT.\n\n";
getch();
fo.write((char *)&p,sizeof(p));
fo.close();
fi.close();
remove("PROFILE.DAT");
rename("temp.dat","PROFILE.DAT");
void bank::withdraw()
prof p;
long double z;
ifstream fi("PROFILE.DAT",ios::binary);
ofstream fo("temp.dat",ios::binary);
while(fi.read((char *)&p,sizeof(p)))
if(!strcmp(n,p.n))
r:
clrscr();
cout<<" ATM\n";
cout<<" =======\n\n";
cout<<"_______________________________________________________________________________\n\n\
n";
cout<<"------------------------------------\n";
13
cout<<"CURRENT BALANCE: Rs."<<p.b<<endl;
cout<<"------------------------------------\n\n";
cin>>z;
cout<<"INVALID AMOUNT!\n";
getch();
cout<<"INVALID AMOUNT!\n";
cout<<"At least Rs.5000/- should be available always into your account.\n ";
getch();
p.b-=z;
cout<<"\n------------------------------------\n";
cout<<"------------------------------------\n\n";
getch();
14
fo.write((char *)&p,sizeof(p));
fo.close();
fi.close();
remove("PROFILE.DAT");
rename("temp.dat","PROFILE.DAT");
void bank::detail()
clrscr();
cout<<" ATM\n";
cout<<" =======\n\n";
cout<<"_______________________________________________________________________________\n\n\
n";
prof p;
ifstream fi("PROFILE.DAT",ios::binary);
while(fi.read((char *)&p,sizeof(p)))
if(!strcmp(n,p.n))
cout<<"USERNAME : "<<p.n<<endl;
cout<<"PASSWORD : "<<p.a[4]<<endl<<endl;
cout<<"NAME : "<<p.a[0]<<endl;
cout<<"ADDRESS : "<<p.a[1]<<endl;
cout<<"EMAIL ID : "<<p.a[2]<<endl;
break;
15
}
getch();
fi.close();
void bank::del()
char zz;
repeat:
clrscr();
cout<<" ATM\n";
cout<<" =======\n\n";
cout<<"_______________________________________________________________________________\n";
cout<<"\n\n";
zz=getche();
if(zz=='y'||zz=='Y')
getch();
prof p;
ifstream fi("PROFILE.DAT",ios::binary);
ofstream fo("TEMP.DAT",ios::binary);
while(fi.read((char *)&p,sizeof(p)))
16
if(strcmp(n,p.n))
fo.write((char *)&p,sizeof(p));
fi.close();
fo.close();
remove("PROFILE.DAT");
rename("TEMP.DAT","PROFILE.DAT");
else if(zz=='N'||zz=='n')
else
getch();
void bank::home()
char a;
while(1)
repeat:
clrscr();
cout<<" ATM\n";
cout<<" =======\n\n";
17
cout<<"1.DEPOSIT 2.WITHDRAW 3.ACCOUNT DETAIL 4.DELETE ACCOUNT 5.LOG OUT\n";
cout<<"_______________________________________________________________________________\n";
cout<<"\n\n";
cout<<"WELCOME SIR/MAM\n";
gotoxy(1,21);
cout<<"_______________________________________________________________________________\n";
a=getche();
getch();
void main()
bank b;
b.start();
18
SAMPLE OUTPUT
PAGE 1:
PAGE 2:
19
PAGE 3:
PAGE 4:
PAGE 5:
20
PAGE 3:
PAGE 4:
PAGE 5:
21
BIBLIOGRAPHY
22