Certificate Acknowledgement Header Files and Their Purpose Coding Outputs Requirement Bibliography
Certificate Acknowledgement Header Files and Their Purpose Coding Outputs Requirement Bibliography
Certificate
Acknowledgement
Coding
Outputs
Requirement
Bibliography
Certificate
This to certify that DIKSHANT GAUTAM
of Class XII A has prepared the report on the Project entitled
“Banking Management System”. The report is the result of his
efforts & endeavors. The report is found worthy of acceptance as
final project report for the subject Computer Science of class
XII.
He has prepared the report under my guidance.
(Ms. Priyanka)
PGT (Computer Science)
Department of Computer Science
Himalaya Public Sr. Sec. School
Rohini
Certificate
SIGNATURE OF EXAMINER
Acknowledgement
I would like to express a deep sense of thanks & gratitude
to my project guide Ms. Priyanka Ma’am for guiding me
immensely through the course of the project. She always evinced
keen interest in my work. Her constructive advice & constant
motivation have been responsible for the successful completion
of this project.
DIKSHANT GAUTAM
XII
Header Files Used And Their
Purpose
1. <fstream.h> - For file handling , cin and cout.
#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<iomanip.h>
#include<process.h>
class bank //Class Bank
{
int accno;
float balance;
char name[20],type;
int pass;
public:
void openacc() //Member function to input data
{
cout<<"\nEnter account holders Name:";
gets(name);
cout<<"\nEnter account number:";
cin>>accno;
cout<<"\nType of Account(S/C)" ;
cin>>type;
cout<<"\nEnter initial opening amount \n>=500 for
savings >=1000 for current:";
cin>>balance;
cout<<"\nEnter Passcode(6 digit)";
cin>>pass;
cout<<"\n\nAccount
opened________________________________________";
}
void change() //Member function tomodify
{
cout<<"\nEnter account holders Name:";
gets(name);
cout<<"\nType of Account(S/C)" ;
cin>>type;
}
float retbal() //Member function to return balance
{
return(balance);
}
}
f.close();
if(flag==0)
{
cout<<"\n\nInvalid Account No.";
}
}
void withdraw() //Function to withdraw
{
bank b;
int acno,flag=0;
float amt;
cout<<"\n\nEnter the account no to be withdrawn";
cin>>acno;
fstream f("Bank.dat",ios::in|ios::out|ios::binary);
while(!f.eof())
{
int passcode;
int pos=f.tellg();
f.read((char*)&b,sizeof(bank));
if(b.retacc()==acno)
{
flag=1;
cout<<"\n\nEnter your account passcode";
cin>>passcode;
if(passcode==b.retpass())
{
cout<<"\nEnter the amount to be withdrawn";
cin>>amt;
b.draw(amt);
f.seekp(pos);
f.write((char*)&b,sizeof(bank));
cout<<"\n\nAccount Withdrawn";
}
else
cout<<"Incorrect passcode";
break;
}
}
f.close();
if(flag==0)
{
cout<<"\n\nInvalid Account No.";
}
}
void balance() //Function to show balance
{
bank b;
int acno,flag=0,passcode;
float balance;
cout<<"\n\nEnter the account no " ;
cin>>acno;
ifstream in("Bank.dat",ios::out|ios::binary);
while(!in.eof())
{
in.read((char*)&b,sizeof(bank));
if(b.retacc()==acno)
{
flag=1;
cout<<"Enter your passcode";
cin>>passcode;
if(passcode==b.retpass())
{
balance=b.retbal();
cout<<"\n\nBalance:"<<balance;
break;
}
else
cout<<"\nInvalid Passcode";
}
}
if(flag==0)
{
cout<<"\n\nInvalid account no.";
}
in.close();
}
void modify() //Function to make changes
{
bank b;
int acno,flag=0,passcode;
cout<<"\n\nEnter the account no " ;
cin>>acno;
fstream f("Bank.dat",ios::in|ios::out|ios::binary);
while(!f.eof())
{
int pos=f.tellg();
f.read((char*)&b,sizeof(bank));
if(b.retacc()==acno)
{
flag=1;
cout<<"\nEnter your passcode";
cin>>passcode;
if(passcode==b.retpass())
{
f.seekp(pos);
b.change();
f.write((char*)&b,sizeof(bank));
cout<<"\n\nModifications Succesfully
Completed";
break;
}
else
{
cout<<"\n\nInvalid passcode";
}
}
}
if(flag==0)
{
cout<<"\n\nInvalid account no.";
}
f.close();
}
void close() //Function to close account
{
bank b;
int acno,flag=0;
cout<<"\n\nEnter the account no:";
cin>>acno;
ifstream in("Bank.dat",ios::in|ios::binary);
ofstream of("New.dat",ios::out|ios::binary);
while(!in.eof())
{
in.read((char*)&b,sizeof(bank));
if(acno!=b.retacc())
{
of.write((char*)&b,sizeof(bank));
}
else
{
flag=1;
cout<<"\nAccount Deleted";
}
if(flag==0)
{
cout<<"\nInvalid Account no";
}
of.close();
in.close();
remove("Bank.dat");
rename("New.dat","Bank.dat");
}
void View() //Function to view all data
{
bank b;
ifstream in("bank.dat",ios::in|ios::binary);
while(!in.eof())
{
in.read((char*)&b,sizeof(bank));
b.show();
}
in.close();
}
void main()
{
clrscr();
textcolor(BLACK);
textbackground(WHITE);
int n ;
char ch='Y';
while(ch=='Y'||ch=='y')
{
clrscr();
cout<<"Main Menu";
cout<<"\n\n1.New Account\n2.Deposit\n";
cout<<"3.Withdraw\n4.Modify";
cout<<"\n5.View all data\n6.Close Account";
cout<<"\n7.Balance Enquiry\n8.Exit";
cout<<"\n\nEnter your choice:";
cin>>n;
switch(n)
{
case 1: clrscr();
newaccount();
break;
case 2: clrscr();
deposit();
break;
case 3: clrscr();
withdraw();
break;
case 4: clrscr();
modify();
break;
case 5: clrscr();
View();
break;
case 6: clrscr();
close();
break;
case 7: clrscr();
balance();
break;
case 8: exit(1);
}
cout<<"\n\nDo You Want To Continue:";
cin>>ch;
}
getch();
}
Requirements
Hardware Required
Printer, to print the required documents of
the project.
Compact Drive.
RAM : 64 MB
HardDisk : 20 GB
Software Required
Operating System : Windows XP
2. http://en.wikipedia.org
Modify
View All Data
Close Account
Balance Enquiry