You are on page 1of 25

PAGE:1

OBJECT ORIENTED PROGRAMMING


Project in c++
Banking management system
CSE :202
TERM PAPER TOPIC:-BANKING MANAGEMENT
SYSTEM..!!
SUBMITTED TO: BY: Mr.DEEPAK VISHWAKARMA
SUBMITTED vinod verma SEC.-c2802B33
PAGE:2
OBJECT ORIENTED PROGRAMMING
REG.10804863
PAGE:3
OBJECT ORIENTED PROGRAMMING
ACKNOWLEDGEMENT
First and foremost I thank my teacher Mr. DEEPAK VISHWAKARMA has assigned me thi
s term paper to bring out my creative capabilities. I express my gratitude to my
parents for being a continuous source of encouragement for all their financial
aid. I would like to acknowledge the assistance provided to me by the library st
aff of LOVELY PROFESSIONAL UNIVERSITY. My heartfelt gratitude to my class-mates
and for helping me to complete my work in time.
VINOD VERMA
PAGE:4
OBJECT ORIENTED PROGRAMMING
Contents:Introduction Header files Welcome to Bank Main menu New user Activities
References
PAGE:5
OBJECT ORIENTED PROGRAMMING
IN THE PROGRAM
There are 3 accounts, when you deposit money in the account is should show you t
he total amount in the account each time you add money to the account and when y
ou withdraw money it should take away the amount withdraw from the balance that
is in the account. //the list of function prototypes void Deposit(); void Withdr
aw(); void Query(); void Show(); void Exit(); char Menu(); ----------Directions:
-----------
A bank updates t customers'' accounts at the end of each month. The bank offers
two types of accounts: savings and checking. Every customer must maintain a mini
mum balance. If a customer's balance falls below the minimum balance, there is a
service charge of $10.00 for savings accounts and $25.00 for checking accounts.
If the balance at the end of the month is at least the minimum balance, the acc
ount receives interest as follows:
a) Savings accounts receive 4% interest. b) Checking accounts with balances up t
o Rs. 1,000 more than the minimum balance receive 3% interest; otherwise, the in
terest is 5%.
PAGE:6
OBJECT ORIENTED PROGRAMMING
The customer's account number (int type), account type (char; s for savings, c f
or checking), and current balance are input from the keyboard.
Output is the account number, account type, current balance (including any inter
est earned), and the amount of interest earned, if any.
The interest will be calculated in a separate function. The balance and interest
rate are passed to the function. The function returns the interest earned.
The minimum account balance, for both checking and savings accounts, is $1,000.
This must be declared as a constant.
Three files must be submitted:
C++ source for the main function C++ source for the interest function The header
file created for the external function #include <iostream> #include <fstream> #
include <iomanip>
PAGE:7
OBJECT ORIENTED PROGRAMMING
// // // ------------------------------------------------***** BANKING MANAGEMEN
T SYSTEM ***** --------------------------------------------------
// //
Create id.txt file with 123450 11 content Create customer.txt (empty)
// Developed by VINOD VERMA
#include<iostream.h> #include<conio.h> #include<fstream.h> #include<iomanip.h> #
include<string.h> #include<stdio.h> #include<dos.h> #include<stdlib.h> #include<
graphics.h>
void org(); void rules(); void main() { clrscr();
PAGE:8
OBJECT ORIENTED PROGRAMMING
textbackground(3); textcolor(1); cout<<"\t\t\t\t----------"; cout<<"\n\t\t\t\tWE
LCOME TO\n"; cout<<"\t\t\t\t----------"<<endl; cout<<"\t\t\t -------------------
------";
cout<<"\n\t\t\t*****BANKING MANAGEMENT SYSTEM*****\n"; cout<<"\t\t\t -----------
--------------";
cout<<"\n\n\nDevloped in C++ using turboc compiler"; cout<<"\n\nDevloped By:-";
cout<<"\n\nVINOD VERMA"<<"\nSECTION:C2802"<<"\nROLL No:B33" <<"\nREG.No:10804863
"<<"\nEmail Id:veeru19verma@yahoo.in"; cout<<"\n\t cout<<"\n\t cout<<"\n\t cout<
<"\n\n\t getch(); clrscr(); char id[10],id1[10],id2[10],name[30],dist[35],street
[30],intro[30]; char age[5],dob[15],quali[25],phone[15],occ[20],pincode[10]; int
n,i,y1,m1,d2,n1,n2; long nid; struct date d1; getdate(&d1); int y=d1.da_year; i
nt m=d1.da_mon; -------------------------------------------------"; LOVELY PROFE
SSIONAL UNIVERSITY JALANDHAR (PUNJAB)"; ----------------------------------------
---------"; PRESS ANY KEY TO CONTINUE..............";
PAGE:9
OBJECT ORIENTED PROGRAMMING
int d=d1.da_day; long wamount=0; long balance; int initial=1000; long dep,wid; c
har trf[10]="Transfer"; char csh[10]="Deposit"; do { clrscr(); cout<<"\n\t\t\t--
---------------------"; cout<<"\n\t\t\tSTATE BANK OF PATIYALA"; cout<<"\n\t\t\t-
----------------------"; cout<<"\n\n\t MAIN MENU.......\n"; cout<<"\n\t1.ORGANIZ
ATION"; cout<<"\n\t2.NEW USER"; cout<<"\n\t3.EXISTING USER"; cout<<"\n\t4.EXIT";
cout<<"\n\n\tSELECT : "; cin>>n; int n3; if(n!=4) { switch(n) { case 1:
PAGE:10
OBJECT ORIENTED PROGRAMMING
{ clrscr(); org(); getch(); break; } case 2: { do { clrscr(); cout<<"\t\t\t\tNEW
USER\n"; cout<<"\t\t\t\t--------"; cout<<"\n\t1.RULES"; cout<<"\n\t2.CREATE NEW
ACCOUNT"; cout<<"\n\t3.EXIT"; cout<<"\n\n\tSELECT : "; cin>>n1; if(n1!=3) { swi
tch(n1) { case 1: { clrscr(); rules(); getch();
PAGE:11
OBJECT ORIENTED PROGRAMMING
break; } case 2: { clrscr(); cout<<"\n\t\t\tRegistration Form"; cout<<"\n\t\t\t-
----------------\n"; cout<<"\tName cout<<"\tAge : "; gets(name); : "; gets(age);
cout<<"\tDate of Birth : "; gets(dob); cout<<"\tQualification : "; gets(quali);
cout<<"\tOccupation cout<<"\tPhone No. cout<<"\tStreet cout<<"\tDistrict cout<<"
\tPin Code cout<<"\tIntroducer int count; char nidfile[15]; ifstream reg("id.txt
"); reg>>nidfile>>count; strcat(nidfile,".txt"); reg.close(); ifstream reg11("id
.txt"); reg11>>nid>>count; reg11.close(); : "; gets(occ); : "; gets(phone); : ";
gets(street); : "; gets(dist); : "; gets(pincode); : "; gets(intro);
PAGE:12
OBJECT ORIENTED PROGRAMMING
ofstream cus("customer.txt",ios::ate); cus<<nid<<" "<<count<<" "<<name<<" " <<ag
e<<" "<<street<<" "<<dist<<" "<<pincode<<" "<<dob<<" "<<quali<<" "<<occ<<" "<<ph
one<<" "<<intro<<" "<<endl; cus.close(); ofstream cusdata(nidfile); cusdata<<nid
<<" "<<initial; //<<" "<<d<<" "<<m<<" "<<y<<" Deposit"; cusdata.close(); randomi
ze(); cout<<"\n\t\t\t\t\tYOUR ACCOUNT IS CREATED\n"; cout<<"\t\t\tYOUR ACCOUNT N
UMBER IS : "<<nid; cout<<"\n\t\t\tYOUR PIN NUMBER IS : "<<count; cout<<"\n\t\t\t
YOUR BALANCE : "<<initial; cout<<"\n\t\t\tPRESS ANY KEY TO GO BACK IN MAIN MENU"
; nid=nid+1; int a=random(10); count=count+a+1; reg11.close(); ofstream add("id.
txt"); add<<nid<<" "<<count; add.close(); getch(); clrscr(); break; } default: {
PAGE:13
OBJECT ORIENTED PROGRAMMING
break; } } } }while(n1!=3); break; } case 3: { do { clrscr(); cout<<"\n\t\t\tExi
sting Users"; cout<<"\n\t\t\t--------------\n"; cout<<"\n\t1.DEPOSIT"; cout<<"\n
\t2.CREDIT"; cout<<"\n\t3.DELETE"; cout<<"\n\t4.ENTRY"; cout<<"\n\t5.DETAILS"; c
out<<"\n\t6.EXIT"; cout<<"\n\n\tSELECT : "; cin>>n3; if(n3!=6) { switch(n3) {
PAGE:14
OBJECT ORIENTED PROGRAMMING
case 1: { clrscr(); int ch1; cout<<"\n\t\t\tDEPOSIT SECTION"; cout<<"\n\t\t\t---
------------"; cout<<"\n\tAccount number : "; gets(id); strcpy(id1,id); strcat(i
d1,".txt"); ifstream dlch(id1); dlch>>ch1; if(ch1==1) { cout<<"\nYOUR ACCOUNT IS
DELETED"; } else { // cout<<"Amount Deposit : ";cin>>dep; ifstream inout(id1);
ofstream inout1(id1,ios::ate|ios::in|ios::out|ios::binary); inout.seekg(7); inou
t1.seekp(7); inout>>balance;
cout<<"\n\tYour Balance : "<<balance; cout<<"\n\tAmount Deposit : ";cin>>dep;
PAGE:15
OBJECT ORIENTED PROGRAMMING
balance=balance+dep; inout1<<balance;
inout.close(); inout1.close();
wamount=dep; ofstream deposit2(id1,ios::ate,ios::end); deposit2<<endl<<balance<<
" "<<y<<" "<<d<<" "<<m<<" "<<wamount<<" "<<csh; deposit2.close(); // inout.close
(); // inout1.close(); cout<<"\n\tNow Your Current Balance : "<<balance; } getch
(); clrscr(); break; } case 2: { clrscr(); int check; cout<<"\n\t\t\tWITH DRAW S
CETION"; cout<<"\n\t\t\t-----------------"; cout<<"\n\tAccount number : "; gets(
id); strcpy(id1,id);
PAGE:16
OBJECT ORIENTED PROGRAMMING
strcat(id1,".txt");
ifstream delcheck(id1); delcheck>>check; if(check==1) { cout<<"\nYOUR ACCOUNT IS
DELETED"; } else { // cout<<"Amount Withdraw : ";cin>>dep; ifstream inout(id1);
ofstream inout1(id1,ios::ate|ios::in|ios::out|ios::binary); inout.seekg(7); ino
ut1.seekp(7); inout>>balance; long fb; cout<<"\tBalance : "<<balance; if(balance
<=1000) { cout<<"\nLESS THAN MINIMUM BALANCE -- RS 1000"; } else { cout<<"\n\tAm
ount Withdraw : "; cin>>dep;
PAGE:17
OBJECT ORIENTED PROGRAMMING
fb=balance-dep; if(balance<=dep) { cout<<"BAL LESS THAN WITH DRAW AMOUNT"; } els
e if (fb<1000) { cout<<"FINAL BALANCE LESS THAN 1000\nSO YOU CANT WITHDRAW SPECI
FIED AMOUNT"; } else { balance=fb; inout1<<balance;
inout.close(); inout1.close();
cout<<"\n\n\n\t\t\tYOUR AMOUNT WITH DRAW SUCCESSFULLY\n"; wamount=dep; ofstream
deposit2(id1,ios::ate,ios::end); deposit2<<endl<<balance<<" "<<y<<" "<<d<<" "<<m
<<" "<<wamount<<" "<<trf; deposit2.close(); // inout.close(); // inout1.close();
PAGE:18
OBJECT ORIENTED PROGRAMMING
cout<<"\tNow Your Balance : "<<balance; } } } getch(); clrscr(); break; } case 3
: { clrscr(); char pin[10],pin1[10],idd[10],idd1[10],ans; cout<<"\n\t\t\tDELETE
SECTION\n"; cout<<"\tAccount Number :" ; gets(idd1); cout<<"\tPin Number : "; ge
ts(pin);
ifstream cus1("customer.txt"); cout<<"Confirm to delete "<<idd1<<" ACCOUNT :(y/n
)"; cin>>ans; if(ans=='y'||'Y') { strcpy(id1,idd1);
strcat(id1,".txt"); ofstream del(id1); del<<"1"<<" "<<"ACCOUNTDELETED"; del.clos
e(); ofstream del1("delete.txt",ios::ate);
PAGE:19
OBJECT ORIENTED PROGRAMMING
del1<<idd1; del1.close(); cout<<"\n\n\t\t\tYour Account Is Deleted"; } else { co
ut<<"Go To Main Menu"; } getch(); break; } case 4: { clrscr(); int ch2; cout<<"\
n\t\t\tENTRY SECTION\n"; cout<<"\nAccount Number : "; gets(id); strcpy(id1,id);
strcat(id1,".txt");
ifstream edel(id1); edel>>ch2; if(ch2==1) { cout<<"YOUR ACCOUNT IS DELETED"; }
PAGE:20
OBJECT ORIENTED PROGRAMMING
else { ifstream detail(id1); int dd=0; cout<<endl; char type[10]; cout<<"Date Am
ount Tpye Balance\n";
cout<<"-----------------------------------------\n"; while(!detail.eof()) {
if(dd!=0) { detail>>balance>>y>>d>>m>>wamount>>type; cout<<d<<"-"<<m<<"-"<<y<<"
"<<wamount<<" "<<type<<" "<<balance<<endl; } else { detail>>id>>balance;//>>y>>d
>>m>>wamount>>type; dd++; }
} } getch();
PAGE:21
OBJECT ORIENTED PROGRAMMING
break; } case 5: { clrscr(); long d1; int pp1,count; cout<<"\t\t\tDETAILS"; cout
<<"\n\tAccount Number : "; cin>>d1; cout<<"\n\tPin Number : "; cin>>pp1;
//cus<<nid<<" "<<count<<" "<<name<<" " <<age<<" "<<street<<" "<<dist<<" "<<pinco
de<<" "<<dob<<" "<<quali<<" "<<occ<<" "<<phone<<" "<<intro<<" "<<endl;
ifstream cus("customer.txt"); int aa=0; while(!cus.eof()) { cus>>nid>>count>>nam
e>>age>>street>>dist>>pincode>>dob>>quali>>occ>>phone>>intro; aa=0; if(d1==nid &
& pp1==count) { cout<<"\nNAME cout<<"\nAGE : "<<name; : "<<age ;
cout<<"\nDATE OF BIRTH : "<<dob ;
PAGE:22
OBJECT ORIENTED PROGRAMMING
cout<<"\nADDRESS cout<<"\n cout<<"\n : "<<street<<","; "<<dist<<","; "<<pincode<
<"."; : "<<phone;
cout<<"\nPHONE NUMBER
cout<<"\nQUALIFICATION : "<<quali; cout<<"\nOCCUPATION cout<<"\nINTRODUCER break
; } else { aa=1; } } if(aa==1) { cout<<"TRY AGAIN " ; } : "<<occ; : "<<intro;
getch(); break; } default: { break; }
PAGE:23
OBJECT ORIENTED PROGRAMMING
} } }while(n3!=6); break; } default: { break; } } } }while(n!=4); } void org() {
cout<<"\n\t\t\t\t----------------------"; cout<<"\n\t\t\t\tSTATE BANK OF PATIYA
LA"; cout<<"\n\t\t\t\t----------------------"; cout<<"\n\n\n\t\t\t\tABOUT ORGANI
ZTION"; cout<<"\n\n\tFOUNDED AT SINCE DEC.2009"; cout<<"\n\n\tFOUNDED BY :VINOD
VERMA Email Id: veeru19verma@yahoo.in ";
cout<<"\n\t\t\t SECTION:C2802B33"<<"\n\t\t\t REG.No:10804863"; cout<<"\n\n\nThis
mini project was developed in CPP"; cout<<"\nusing File Concept in TurboC Compi
ler"; cout<<"\n\n\nPRESS ANY KEY TO GO BACK IN MAIN MENU.........";
PAGE:24
OBJECT ORIENTED PROGRAMMING
} void rules() { clrscr(); cout<<"\n\t\t\t\t------------------------------------
---"; cout<<"\n\t\t\t\STATE BANK OF PATIYALA"; cout<<"\n\t\t\t\t----------------
-----------------------"; cout<<"\n\t Rules To Create New Account:\n";
cout<<"\n\t Your Minimum balance should be Rs.1000"; cout<<"\n\t Your Account is
cancelled when you cannot transaction"; cout<<"\n\t within 3 months";
}
References
E â Balagurusamy Ashoke N Kamthane www.planet-source-code.com/ www.codeproject.com/

You might also like