Computer Project Class 12
Computer Project Class 12
Saksham Arora
Shiven Mian
Index
Sno
1
2
3
4
5
6
Description
Pageno
Certificate
1
Introduction
2
Source Code
4
Output Screen
45
Acknowledgement & References
62
Hardware-software requirement
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. New Account
2. Deposit Amount
3. Withdraw amount
4. Balance Enquiry
5. All Account Holder List
6. Close an Account
7. Modify an Account
With this program it can be assured that, a user friendly
working space would create.
//*************************************************
#include<fstream.h>
#include<ctype.h>
#include<iomanip.h>
#include<conio.h>
#include<stdio.h>
//*************************************************
//
//*************************************************
class account
{
int acno;
char name[20];
int deposit;
char type;
public:
void create_account();
void draw(int);
void report();
int retacno();
int retdeposit();
int rettype();
};
//class ends here
deposit-=x;
}
Function declaration
//*************************************************
void write_account();
void display_sp(int);
void modify_account(int);
void delete_account(int);
void display_all();
void deposit_withdraw(int,int);
account
void intro();
//*************************************************
//
//*************************************************
void main()
{
char ch;
int num;
clrscr();
intro();
do
{
clrscr();
cout<<"\n\n\n\tMain Menu";
cout<<"\n\n\t01. New Account";
cout<<"\n\n\t02. Deposit Amount";
cout<<"\n\n\t03. Withdraw Amount";
write_account();
break;
case '2' :
case '3' :
break;
case '5' : display_all();
break;
case '6' : cout<<"\n\n\tEnter Account No. :: ";
cin>>num;
delete_account(num);
break;
case '7' : cout<<"\n\n\tEnter Account No. :: ";
cin>>num;
modify_account(num);
break;
case '8' : cout<<"\n\n\tThanks for using bank management system";
break;
default :
cout<<"\a";
}
getch();
}while(ch!='8');
}
//*************************************************
//
//*************************************************
void write_account()
{
account ac;
ofstream outfile;
outfile.open("account.dat",ios::binary|ios::app);
ac.create_account();
outfile.write((char*)&ac,sizeof(account));
outfile.close();
}
//*************************************************
//
//*************************************************
void display_sp(int n)
{
account ac;
int flag=0;
ifstream infile;
infile.open("account.dat",ios::binary);
if(!infile)
{
if(ac.retacno()==n)
{
ac.show_account();
flag=1;
}
}
infile.close();
if(flag==0)
cout<<"\n\nAccount Number Does Not Exist";
}
//*************************************************
//
//*************************************************
void modify_account(int n)
{
int found=0;
account ac;
fstream file;
file.open("account.dat",ios::binary|ios::in|ios::out);
if(!file)
{
cout<<"File could not be open !! \nPress any Key...";
getch();
}
while(file.read((char*)&ac,sizeof(account))&&found == 0)
{
if(ac.retacno()==n)
{
ac.show_account();
cout<<"\n\nEnter The New Details of Account "<<endl;
ac.modify();
int pos = (-1)*sizeof(account);
file.seekp(pos,ios::cur);
file.write((char*)&ac,sizeof(account));
cout<<"\n\n\tRecord Updated...";
found = 1;
}
}
file.close();
if(found==0)
cout<<"\n\nRecord Not Found";
}
//*************************************************
//
//*************************************************
void delete_account(int n)
{
account ac;
ifstream infile;
ofstream outfile;
infile.open("account.dat",ios::binary);
if(!infile)
{
cout<<"File could not be open !! \nPress any Key...";
getch();
}
outfile.open("Temp.dat",ios::binary);
infile.seekg(0,ios::beg);
while(infile.read((char*)&ac,sizeof(account)))
{
if(ac.retacno()!=n)
{
outfile.write((char*)&ac,sizeof(account));
}
}
infile.close();
outfile.close();
remove("account.dat");
rename("Temp.dat","account.dat");
cout<<"\n\n\tRecord Deleted...";
}
//*************************************************
//
//*************************************************
void display_all()
{
account ac;
ifstream infile;
infile.open("account.dat",ios::binary);
if(!infile)
{
cout<<"File could not be open !! \nPress any Key...";
getch();
}
cout<<"\n\n\t\tACCOUNT HOLDER LIST\n\n";
cout<<"=====================================================\n";
cout<<"A/c no.
NAME
Type Balance\n";
cout<<"=====================================================\n";
while(infile.read((char*)&ac,sizeof(account)))
{
ac.report();
}
infile.close();
}
//*************************************************
//
//*************************************************
void deposit_withdraw(int n,int option)
{
int amt;
int found=0;
account ac;
fstream file;
file.open("account.dat",ios::binary|ios::in|ios::out);
if(!file)
{
cout<<"File could not be open !! \nPress any Key...";
getch();
}
while(file.read((char*)&ac,sizeof(account))&&found == 0)
{
if(ac.retacno()==n)
{
ac.show_account();
if(option==1)
{
cout<<"\n\n\tTO DEPOSIT AMOUNT";
cout<<"\n\nEnter the amount to be deposit";
cin>>amt;
ac.dep(amt);
}
if(option==2)
{
cout<<"\n\n\tTO WITHDRAW AMOUNT";
cout<<"\n\nEnter the amount to be withdraw";
cin>>amt;
int bal=ac.retdeposit()-amt;
if((bal<500&&ac.rettype()=='S')||(bal<1000&&ac.rettype()=='c'))
cout<<"Insufficient Balance";
else
ac.draw(amt);
}
int pos=(-1)*sizeof(ac);
file.seekp(pos,ios::cur);
file.write((char*)&ac,sizeof(account));
cout<<"\n\n\tRecord Updated...";
found = 1;
}
}
file.close();
if(found==0)
cout<<"\n\nRecord Not Found";
}
//*************************************************
//
Introduction Funtion
//*************************************************
void intro()
{
cout<<"\n\n\n\t BANK";
cout<<"\n\n\tMANAGEMENT";
cout<<"\n\n\t SYSTEM";
cout<<"\n\n\n\nMADE BY : Shiven Mian and Saksham Arora";
cout<<"\n\nSCHOOL : Delhi Public School R.K. Puram";
getch();
}
//*************************************************
//
End of Coding
//*************************************************
Output Screens
Acknowledgement
We would like to express our sincere gratitude to our
Reference
<Websites/Books/Study Material/Class Notes>
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