CS Project CBSE Class 12
CS Project CBSE Class 12
CS Project CBSE Class 12
Index
Sn
o
1
2
3
4
5
6
Description
Certificate
Introduction
Source Code
Output Screen
Acknowledgement &
References
Hardware-software
requirement
Pagen
o
1
2
4
45
62
63
Certificate
This is to certify that Banking Management
System computer science project is
developed by Shiven Mian, and Saksham
Arora under my supervision in the computer
lab of Delhi Public School, R.K.Puram in the
session 2014-2015. The work done by them
is original.
Mr. Mukesh Kumar
Computer Science Teacher
Date: ___________
Introduction
The functioning of the program is so
designed that it is very easy to understand
and operate.
There are seven different options in the main
menu which helps in the administration of
the project, namely:
1.
2.
3.
4.
5.
6.
7.
New Account
Deposit
Withdrawal
Balance Enquiry
All Account Holder List
Close an Account
Modify an Account
//*************************************************
#include<fstream.h>
#include<conio.h>
#include<stdio.h>
//*************************************************
//
//*************************************************
class acc{
int ano;
//Account No.
char nam[20];
float bal;
char type;
public:
void disp();
void in();
void depo(int);
void wid(int);
int Rno(){
return ano; }
"<<nam<<"
";
"<<bal<<endl;
}
//*************************************************
//
Function declaration
//*************************************************
void cracc();
void DISP();
void modify();
void cloacc();
void withdraw();
void deposit();
for given account
void chbal();
//*************************************************
//
//*************************************************
void main(){
clrscr();
cout<<"*********************************************************************
**********";
cout<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"
BANK"<<endl<<endl<<endl<<endl;
cout<<"
MANAGEMENT"<<endl<<endl<<endl<<endl;
cout<<"
SYSTEM"<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"
Saksham Arora";
cout<<
cout<<endl<<endl<<endl<<"**********************************************
********************************";
getch();
char ch;
do{
clrscr();
cout<<"------------------------WELCOME TO BANKING MANAGEMENT
SYSTEM-------------------"<<endl;
cout<<endl;
cout<<endl<<" MAIN MENU"<<endl;
cout<<"
cout<<"
2. DEPOSIT"<<endl;
cout<<"
3. WITHDRAWAL"<<endl;
cout<<"
4. BALANCE"<<endl;
cout<<"
cout<<"
6. CLOSE ACCOUNT"<<endl;
cout<<"
7. MODIFY ACCOUNT"<<endl;
cout<<"
8. EXIT"<<endl<<"SELECT OPTION<1-8>";
cin>>ch;
switch(ch)
{
case '1'
cracc();
break;
case '2'
deposit();
break;
case '3'
withdraw();
break;
case '4'
chbal();
break;
case '5'
DISP();
break;
case '6'
cloacc();
break;
case '7'
modify();
break;
}
}while(ch!='8');
//*************************************************
//
//*************************************************
void cracc(){
clrscr();
acc A;
fstream f;
f.open("ACCOUNTS.DAT",ios::binary|ios::app);
A.in();
f.write((char*)&A,sizeof(A));
f.close();
cout<<endl<<"Account Creation Successful!";
getch();
}
//*************************************************
//
//*************************************************
void chbal(){
clrscr();
fstream f;
acc A;
int found=0;
int pos=0;
int no;
cout<<"Account No. :";cin>>no;
f.open("ACCOUNTS.DAT",ios::binary|ios::in);
while( f.read((char*)&A,sizeof(A)) && found==0)
{
pos++;
if(A.Rno()==no)
found++;
}
if(found!=0)
A.disp();
else cout<<"INVALID ACCOUNT NO";
f.close();
getch();
}
//*************************************************
//
//*************************************************
void modify(){
clrscr();
fstream f;
acc A,B;
int found=0;
int pos=0;
int no;
cout<<"Account No. :";cin>>no;
f.open("ACCOUNTS.DAT",ios::binary|ios::out|ios::in);
while( f.read((char*)&A,sizeof(A)) && found==0)
{
pos++;
if(A.Rno()==no)
found++;
}
if(found!=0){
B.in();
f.seekp((pos-1)*sizeof(B));
f.write((char*)&B,sizeof(B));
f.close();
}
else cout<<"INVALID ACCOUNT NO";
getch();
}//*************************************************
//
//*************************************************
void cloacc(){
clrscr();
fstream f,g;
acc A;
int found=0;
int no;
cout<<"Account No. to be closed:";cin>>no;
f.open("ACCOUNTS.DAT",ios::binary|ios::in);
g.open("TEMP.DAT",ios::binary|ios::out);
while( f.read((char*)&A,sizeof(A)) && found==0) //check if account is
present in file
{
if(A.Rno()==no)
found++;
if(found!=0){
to be deleted
f.seekg(0,ios::beg);
while(f.read((char*)&A,sizeof(A))){
if(A.Rno()!=no){
g.write((char*)&A,sizeof(A));
}
else cout<<"ACCOUNT DELETED";
}
}
else cout<<"INVALID ACCOUNT NO";
g.close();
f.close();
remove("ACCOUNTS.DAT");
rename("TEMP.DAT","ACCOUNTS.DAT");
getch();
}
//*************************************************
//
//*************************************************
void DISP()
{
clrscr();
acc A;
fstream f;
f.open("ACCOUNTS.DAT",ios::binary|ios::in);
cout<<"\n\n\t\tACCOUNT HOLDER LIST\n\n";
cout<<"=========================================
============\n";
cout<<"A/c no.
NAME
Type Balance\n";
cout<<"=========================================
============\n";
while(f.read((char*)&A,sizeof(A)))
{
A.disp();
}
f.close();
getch();
}
//*************************************************
//
//*************************************************
void deposit()
{
clrscr();
fstream f;
acc A;
int found=0;
int pos=0;
int no,dep;
cout<<"Account No. :";cin>>no;
f.open("ACCOUNTS.DAT",ios::binary|ios::in|ios::out);
while( f.read((char*)&A,sizeof(A)) && found==0)
{
pos++;
if(A.Rno()==no)
found++;
if(found!=0){
f.seekg((pos-1)*sizeof(A));
cout<<"Enter amount to be deposited";cin>>dep;
A.depo(dep);
f.write((char*)&A,sizeof(A));
cout<<"DEPOSIT SUCCESSFUL";
}
}
if(found==0) cout<<"NOT FOUND";
f.close();
getch();
}
void withdraw()
{
clrscr();
fstream f;
acc A;
int found=0;
int pos=0;
int no,mon;
cout<<"Account No. :";cin>>no;
f.open("ACCOUNTS.DAT",ios::binary|ios::in|ios::out);
while( f.read((char*)&A,sizeof(A)) && found==0 )
{
pos++;
if(A.Rno()==no)
found++;
if(found!=0){
f.seekg((pos-1)*sizeof(A));
cout<<"Enter amount to be withdrawn";cin>>mon;
if(A.Rbal()>mon){
A.wid(mon);
f.write((char*)&A,sizeof(A));
cout<<"WITHDRAWAL SUCCESSFUL";
}
else cout<<"Insufficent balance";
}
}
f.close();
if(found==0)
cout<<"NOT FOUND";
getch();
}//
End of Coding//*************************************************
Output Screens
Acknowledgement
We would like to express our sincere
gratitude to our computer science teacher
Mr. Mukesh Kumar, for his vital support,
guidance and encouragement without
which this project would not have come
forth. We would also like to express our
gratitude to the school for letting us use the
school
laboratory.
Different
kinds
of
reference books and sites were very useful in
understanding the component required by
the project and completing it.
Reference
Class Notes
cplusplus.com