Вы находитесь на странице: 1из 22

Banking Management System

Version 1.0 (2014-2015)

Computer Science Project


Developed By
Saksham Arora
Shiven Mian

Delhi Public School, R.K.Puram, New Delhi


www.dpsrkp.net

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

With this program it can be assured that, a


user friendly working space would be
created.

Source C++ Code


//*************************************************
//

Header file used in Project

//*************************************************
#include<fstream.h>
#include<conio.h>
#include<stdio.h>
//*************************************************
//

Class used in Project

//*************************************************
class acc{
int ano;

//Account No.

char nam[20];
float bal;

//Name of account holder


//Account Balance

char type;

//Account type : Current(C)/Savings(S)

public:
void disp();

//Display Account information

void in();

//Input Account information

void depo(int);

//Deposit amount specified

void wid(int);

//Withdraw amount specified

int Rno(){

return ano; }

char *Rnam(){ return nam; }


float Rbal(){ return bal; }
char Rtype(){ return type; }
};
//class ends here
void acc::in(){
clrscr();

cout<<"----------------------------NEW ACCOUNT CREATION


FORM--------------------------"<<endl<<endl;
cout<<"Account no:"<<endl;cin>>ano;
cout<<"Account holder name :"<<endl; gets(nam);
cout<<"Account type Current(C)/Savings(S) :";cin>>type;
cout<<"Enter intial account:"<<endl<<">=500 for savings >=1000
for current";
cin>>bal;
}
void acc::depo(int a){
bal=bal+a;
}
void acc::wid(int b){
bal=bal-b;
}
void acc::disp()
{
cout<<ano<<"
cout<<type<<"

"<<nam<<"

";

"<<bal<<endl;

}
//*************************************************
//

Function declaration

//*************************************************
void cracc();
void DISP();

//function to create account in binary file


//function to display all accounts

void modify();

//function to modify record of file

void cloacc();

//function to delete record of file

void withdraw();

void deposit();
for given account

//functions to deposit/withdraw amount

void chbal();

//function to check balance of an account

//*************************************************
//

The main function of program

//*************************************************
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<<

MADE BY: Shiven Mian and

SCHOOL: Delhi Public School R.K Puram;

cout<<endl<<endl<<endl<<"**********************************************
********************************";
getch();
char ch;
do{
clrscr();
cout<<"------------------------WELCOME TO BANKING MANAGEMENT
SYSTEM-------------------"<<endl;
cout<<endl;
cout<<endl<<" MAIN MENU"<<endl;
cout<<"

1. CREATE NEW ACCOUNT"<<endl;

cout<<"

2. DEPOSIT"<<endl;

cout<<"

3. WITHDRAWAL"<<endl;

cout<<"

4. BALANCE"<<endl;

cout<<"

5. ALL ACCOUNT HOLDER LIST"<<endl;

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');

//*************************************************
//

Function to write in file

//*************************************************
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();
}
//*************************************************
//

Function to read specific record from file

//*************************************************
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();
}

//*************************************************
//

Function to modify record of file

//*************************************************
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();
}//*************************************************
//

Function to delete record of file

//*************************************************
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

//copy all records to temp except account

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();
}
//*************************************************
//

Function to display all account deposit list

//*************************************************
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();
}
//*************************************************
//

Function to deposit and withdraw amounts

//*************************************************
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

Hardware & Software


Requirement
Hardware Requirement
Pentium 3/4/Core 2 Duo/Dual core/i3/i5/i7
With at least 256 MB RAM
2 MB free space on Hard Disk
Color Monitor/LCD
Operating System & Compiler
MS Windows
Turbo C++ 3.0 Compiler

Вам также может понравиться