SlideShare a Scribd company logo
COMPUTER SCIENCE
INVESTIGATORY PROJECT
TOPIC:- BANK MANAGEMENT
SYSTEM
BY
DIVYANSHU KUMAR
CLASS XII-A
2018-19
KENDRIYA VIDYALAYA NO 2
NAUSENABAGH, VISAKHAPATNAM
DEPARTMENT OF COMPUTER
SCIENCE
CERTIFICATE
This is to certify that DIVYANSHU
KUMAR of Class XII A has prepared the
investigatory project entitled “BANK
MANAGEMENT SYSTEM”. The project is the
result of his efforts and endeavors. The report is
found worthy of acceptance as final project
report. He has prepared the report under my
guidance.
PGT (COMPUTER SCIENCE)
D E C L A R A T I O N
I hereby declare that the project work
entitled “BANK MANAGEMENT SYSTEM”,
submitted to Department of Computer
Science, Kendriya Vidyalaya No. 2,
Nausenabaugh, Visakhapatnam is prepared
by me.
DIVYANSHU KUMAR
Class: XII A
Cbse roll no-
ACKNOWLEDGEMENT
Through this acknowledgement I express my sincere gratitude to
all those people who have been associated with the project and
helped meto makeit a worthwhileexperience.
Iextend my thanksto ourprincipal Mr.NishikantAggarwal
and (PGTComputerScience) fortheir
valuable guidance.
I would like to express my gratitude towards my parents for their
co-operation and encouragement which helped me to complete
this project.
S.No. CONTENTS
1. Introduction
2. Intro. To OOP
INDEX
3. Intro. To Data File
Handling
4. About The
Program
5. Header File Used
6. Source Code
7. Output
8. Bibliography
INTRODUCTION
C++ is a statically typed, compiled, general purpose, case-sensitive, free-
form programming language that supports procedural, object-oriented,
and generic programming. C++ is regarded as a middle-level language,
as it comprises a combination of both high-level and low-level language
features. C++ was developed by Bjarne Stroustrupstarting in 1979 at Bell
Labs in Murray Hill, New Jersey as an enhancement to the C language
and originally named C with Classes but later it was renamed
C++ in 1983.C++ is a superset of C, and that virtually any legal C
program is a legal C++ program. The most important thing to do when
learning C++ is to focus on concepts and not get lost in language
technical details. C++ is used by hundreds of thousands of programmers
in essentially every application domain. C++ is being highly used to write
device drivers and other software that rely on direct manipulation of
hardware under real time constraints. C++ is widely used for teaching
and research because it is cleaning enough for successful teaching of
basic concepts. Anyone who has used either an apple Macintosh or a PC
running windows has directly used C++ because the primary user
interfaces of these systemare written in C++.
INTRODUCTION TO OBJECT ORIENTED
PROGRAMMING CONCEPTS
Object Oriented Programming is a programming style that is
associated with the concept of Class, Objects and various other
concepts revolving around these two, like Inheritance,
Polymorphism, Abstraction, Encapsulation etc.
Basic OOPS concepts in c++
Here we will try to explain all the OOP concepts through this
example and later we will have the technical definitons for all
this.
Class
Here we can take Human Being as a class. A class is a blueprint
for any functional entity which defines its properties and its
functions. Like Human Being, having body parts, and performing
various actions.
Inheritance
Considering HumanBeing a class, which has properties like
hands, legs, eyes etc, and functions like walk, talk, eat, see etc.
Male and Female are also classes, but most of the properties and
functions are included in HumanBeing, hence they can inherit
everything from class HumanBeing using the concept of
Inheritance.
Abstraction
Abstraction means, showcasing only the required things to the
outside world while hiding the details. Continuing our example,
Human Being's can talk, walk, hear, eat, but the details are hidden
from the outside world. We can take our skin as the Abstraction
factor in our case, hiding the inside mechanism.
Encapsulation
This concept is a little tricky to explain with our example. Our
Legs are binded to help us walk. Our hands, help us hold things.
This binding of the properties to functions is called
Encapsulation.
Polymorphism
Polymorphism is a concept, which allows us to redefine the way
something works, by either changing how it is done or by
changing the parts using which it is done. Both the ways have
different terms for them.
If we walk using our hands, and not legs, here we will change the
parts used to perform something. Hence this is called
Overloading.
And if there is a defined way of walking, but I wish to walk
differently, but using my legs, like everyone else. Then I can walk
like I want, this will be called as Overriding.
OOPS Concept Definitions
Now, let us discuss some of the main features of Object Oriented
Programming which you will be using in C++(technically).
Objects
Classes
Abstraction
Encapsulation
Inheritance
Overloading
Exception Handling
Objects
Objects are the basic unit of OOP. They are instances of class,
which have data members and uses various member functions to
perform tasks.
Class
It is similar to structures in C language. Class can also be defined
as user defined data type but it also contains functions in it. So,
class is basically a blueprint for object. It declare & defines what
data variables the object will have and what operations can be
performed on the class's object.
Abstraction
Abstraction refers to showing only the essential features of the
application and hiding the details. In C++, classes provide
methods to the outside world to access & use the data variables,
but the variables are hidden from direct access. This can be done
access specifiers.
Encapsulation
It can also be said data binding. Encapsulation is all about binding
the data variables and functions together in class.
Inheritance
Inheritance is a way to reuse once written code again and again.
The class which is inherited is called base calls & the class which
inherits is called derived class. So when, a derived class inherits a
base class, the derived class can use all the functions which are
defined in base class, hence making code reusable.
It is a feature, which lets us create functions with same name but
different arguments, which will perform differently. That is
function with same name, functioning in different way. Or, it also
allows us to redefine a function to provide its new definition. You
will learn how to do this in details soon in coming lessons.
Exception Handling
Exception handling is a feature of OOP, to handle unresolved
exceptions or errors produced at runtime from the outside world.
We can take our skin as the Abstraction factor in our case, hiding
the inside mechanism.
INTRODUTION TO DATA FILE
HANDLING
Most computersprograms workwith files. This is because
files help in storing information permanently. A fileis itselfa
bunchofbytesstored onsome storagedevice like tape,or
magnetic disk, etc.
In C++, file input/outputfacilities are implemented
throughacomponentheaderfile pf C++ standardlibrary.
This headeris fstream.h.
In C++, a file, atlowest level, is interpretedsimply as a
sequence,or streamof bytes.One aspectof the file I/O
library managesthetransferof thesebytes.
The fstream library predefines a set of operations for
handling file related input and output. It defines certain
classes thathelpone performfile input andoutput.
ABOUT THE PROGRAM
The project “Bank Management System” has been
developed as a very understandable Databaseof methods
that can be created and handle easily. When you add a
person acc. details to the database, the details is added
automatically and settled in the binary file.
The project aimed to create an easy database which can be
handled and created easily. Generally, the database is being
a master file that possessesthe tabular format of person’s
acc. details, the sub menu for the account like acc. no. ,
deposit, name and menu option return.
HEADER FILES USED IN
PROGRAM
 fstream.h – For file handling, cin,
cout.
 stdio.h – For standard I/O
operations.
 process.h – For exit() function.
 iomanip.h – For setw() function.
 conio.h – For clrscr() & getch()
function.
 ctype.h – For toupper() function.
SOURCE CODE
//***************************************************************
// HEADER FILE USED IN PROJECT
//****************************************************************
#include<fstream.h>
#include<ctype.h>
#include<iomanip.h>
#include<conio.h>
#include<stdio.h>
//***************************************************************
// CLASS USED IN PROJECT
//****************************************************************
class account
{
int acno;
char name[50];
int deposit;
char type;
public:
void create_account(); //function to get data from user
void show_account(); //function to show data on screen
void modify(); //function to get new data from user
void dep(int); //function to accept amount and add to balance amount
void draw(int); //function to accept amount and subtract from balance
amount
void report(); //function to show data in tabular format
int retacno(); //function to return account number
int retdeposit(); //function to return balance amount
char rettype(); //function to return type of account
}; //class ends here
void account::create_account()
{
cout<<"nEnter The account No.";
cin>>acno;
cout<<"nnEnter The Name of The account Holder : ";
gets(name);
cout<<"nEnter Type of The account (C/S) : ";
cin>>type;
type=toupper(type);
cout<<"nEnter The Initial amount(>=500 for Saving and >=1000 for current
) : ";
cin>>deposit;
cout<<"nnnAccount Created..";
}
void account::show_account()
{
cout<<"nAccount No. : "<<acno;
cout<<"nAccount Holder Name : ";
cout<<name;
cout<<"nType of Account : "<<type;
cout<<"nBalance amount : "<<deposit;
}
void account::modify()
{
cout<<"nThe account No."<<acno;
cout<<"nnEnter The Name of The account Holder : ";
gets(name);
cout<<"nEnter Type of The account (C/S) : ";
cin>>type;
type=toupper(type);
cout<<"nEnter The amount : ";
cin>>deposit;
}
void account::dep(int x)
{
deposit+=x;
}
void account::draw(int x)
{
deposit-=x;
}
void account::report()
{
cout<<acno<<setw(10)<<" "<<name<<setw(10)<<"
"<<type<<setw(6)<<deposit<<endl;
}
int account::retacno()
{
return acno;
}
int account::retdeposit()
{
return deposit;
}
char account::rettype()
{
return type;
}
//***************************************************************
// function declaration
//****************************************************************
void write_account(); //function to write record in binary file
void display_sp(int); //function to display account details given by user
void modify_account(int); //function to modify record of file
void delete_account(int); //function to delete record of file
void display_all(); //function to display all account details
void deposit_withdraw(int, int); // function to desposit/withdraw amount for given
account
void intro(); //introductory screen function
//***************************************************************
// THE MAIN FUNCTION OF PROGRAM
//****************************************************************
int main()
{
char ch;
int num;
clrscr();
intro();
do
{
clrscr();
cout<<"nnntMAIN MENU";
cout<<"nnt01. NEW ACCOUNT";
cout<<"nnt02. DEPOSIT AMOUNT";
cout<<"nnt03. WITHDRAW AMOUNT";
cout<<"nnt04. BALANCE ENQUIRY";
cout<<"nnt05. ALL ACCOUNT HOLDER LIST";
cout<<"nnt06. CLOSE AN ACCOUNT";
cout<<"nnt07. MODIFY AN ACCOUNT";
cout<<"nnt08. EXIT";
cout<<"nntSelect Your Option (1-8) ";
cin>>ch;
clrscr();
switch(ch)
{
case '1':
write_account();
break;
case '2':
cout<<"nntEnter The account No. : "; cin>>num;
deposit_withdraw(num, 1);
break;
case '3':
cout<<"nntEnter The account No. : "; cin>>num;
deposit_withdraw(num, 2);
break;
case '4':
cout<<"nntEnter The account No. : "; cin>>num;
display_sp(num);
break;
case '5':
display_all();
break;
case '6':
cout<<"nntEnter The account No. : "; cin>>num;
delete_account(num);
break;
case '7':
cout<<"nntEnter The account No. : "; cin>>num;
modify_account(num);
break;
case '8':
cout<<"nntThanks for using bank managemnt system";
break;
default :cout<<"a";
}
getch();
}while(ch!='8');
return 0;
}
//***************************************************************
// function to write in file
//****************************************************************
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();
}
//***************************************************************
// function to read specific record from file
//****************************************************************
void display_sp(int n)
{
account ac;
int flag=0;
ifstream inFile;
inFile.open("account.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
return;
}
cout<<"nBALANCE DETAILSn";
while(inFile.read((char *) &ac, sizeof(account)))
{
if(ac.retacno()==n)
{
ac.show_account();
flag=1;
}
}
inFile.close();
if(flag==0)
cout<<"nnAccount number does not exist";
}
//***************************************************************
// function to modify record of file
//****************************************************************
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 !! Press any Key...";
return;
}
while(File.read((char *) &ac, sizeof(account)) && found==0)
{
if(ac.retacno()==n)
{
ac.show_account();
cout<<"nnEnter 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<<"nnt Record Updated";
found=1;
}
}
File.close();
if(found==0)
cout<<"nn Record Not Found ";
}
//***************************************************************
// function to delete record of file
//****************************************************************
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 !! Press any Key...";
return;
}
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<<"nntRecord Deleted ..";
}
//***************************************************************
// function to display all accounts deposit list
//****************************************************************
void display_all()
{
account ac;
ifstream inFile;
inFile.open("account.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
return;
}
cout<<"nnttACCOUNT HOLDER LISTnn";
cout<<"====================================================
n";
cout<<"A/c no. NAME Type Balancen";
cout<<"====================================================
n";
while(inFile.read((char *) &ac, sizeof(account)))
{
ac.report();
}
inFile.close();
}
//***************************************************************
// function to deposit and withdraw amounts
//****************************************************************
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 !! Press any Key...";
return;
}
while(File.read((char *) &ac, sizeof(account)) && found==0)
{
if(ac.retacno()==n)
{
ac.show_account();
if(option==1)
{
cout<<"nntTO DEPOSITE AMOUNT ";
cout<<"nnEnter The amount to be deposited : ";
cin>>amt;
ac.dep(amt);
}
if(option==2)
{
cout<<"nntTO WITHDRAW AMOUNT ";
cout<<"nnEnter The amount to be withdraw : ";
cin>>amt;
int bal=ac.retdeposit()-amt;
if((bal<500 && ac.rettype()=='S') || (bal<1000 &&
ac.rettype()=='C'))
cout<<"Insufficience balance";
else
ac.draw(amt);
}
int pos=(-1)* sizeof(ac);
File.seekp(pos,ios::cur);
File.write((char *) &ac, sizeof(account));
cout<<"nnt Record Updated";
found=1;
}
}
File.close();
if(found==0)
cout<<"nn Record Not Found ";
}
//***************************************************************
// INTRODUCTION FUNCTION
//****************************************************************
void intro()
{
cout<<"nnnt BANK MANAGEMENT SYSTEM n";
cout<<"t -------------------------------";
cout<<"nn MADE BY : DIVYANSHU & DEEPAK ";
cout<<"nn SCHOOL : Kendriya Vidyalaya No.2,NSB,Vizag”;
getch();
}
//***************************************************************
// END OF PROJECT
//***************************************************************
OUTPUT OF THE
PROGRAM
BIBLIOGRAPHY
HELP FROM
INTERNET
INFORMATION
FROM LIBARY
TEACHER’S
GUIDANCE
CSc investigatory project

More Related Content

What's hot

IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
siddharthjha34
 
Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQL
Darshit Vaghasiya
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
Harsh Kumar
 
Aldehydes and Ketones
Aldehydes and KetonesAldehydes and Ketones
Aldehydes and Ketones
Shivam420J
 
Computer science investigatory project- computer shop
Computer science investigatory project- computer shopComputer science investigatory project- computer shop
Computer science investigatory project- computer shop
Yash Panwar
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Self-employed
 
Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)
PiyushKashyap54
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science Project
Ashwin Francis
 
Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12
OmRanjan2
 
Library management
Library managementLibrary management
Library management
Vishnu Prasad
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XII
YugenJarwal
 
Computer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school managementComputer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school management
RemaDeosiSundi
 
Chemistry Investigatory Project of class 12th CBSE
Chemistry Investigatory Project  of class 12th CBSEChemistry Investigatory Project  of class 12th CBSE
Chemistry Investigatory Project of class 12th CBSE
Nagesh Agrawal
 
Informatics Practices Project on Tour and travels
 Informatics Practices Project on Tour and travels  Informatics Practices Project on Tour and travels
Informatics Practices Project on Tour and travels
Harsh Mathur
 
Computer Science investigatory project class 12
Computer Science investigatory project class 12Computer Science investigatory project class 12
Computer Science investigatory project class 12
Raunak Yadav
 
352180832 dna-fingerprint-investigatory-project-class-12 (1)
352180832 dna-fingerprint-investigatory-project-class-12 (1)352180832 dna-fingerprint-investigatory-project-class-12 (1)
352180832 dna-fingerprint-investigatory-project-class-12 (1)
Chiranjeet Samantaray
 
Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...
deboshreechatterjee2
 
Cbse computer science (c++) class 12 board project bank managment system
Cbse computer science (c++)  class 12 board project  bank managment systemCbse computer science (c++)  class 12 board project  bank managment system
Cbse computer science (c++) class 12 board project bank managment system
pranoy_seenu
 
PYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEMPYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEM
vikram mahendra
 
Chemistry Practical File
Chemistry Practical FileChemistry Practical File
Chemistry Practical File
Saksham Mittal
 

What's hot (20)

IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
 
Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQL
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
Aldehydes and Ketones
Aldehydes and KetonesAldehydes and Ketones
Aldehydes and Ketones
 
Computer science investigatory project- computer shop
Computer science investigatory project- computer shopComputer science investigatory project- computer shop
Computer science investigatory project- computer shop
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12
 
Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science Project
 
Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12
 
Library management
Library managementLibrary management
Library management
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XII
 
Computer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school managementComputer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school management
 
Chemistry Investigatory Project of class 12th CBSE
Chemistry Investigatory Project  of class 12th CBSEChemistry Investigatory Project  of class 12th CBSE
Chemistry Investigatory Project of class 12th CBSE
 
Informatics Practices Project on Tour and travels
 Informatics Practices Project on Tour and travels  Informatics Practices Project on Tour and travels
Informatics Practices Project on Tour and travels
 
Computer Science investigatory project class 12
Computer Science investigatory project class 12Computer Science investigatory project class 12
Computer Science investigatory project class 12
 
352180832 dna-fingerprint-investigatory-project-class-12 (1)
352180832 dna-fingerprint-investigatory-project-class-12 (1)352180832 dna-fingerprint-investigatory-project-class-12 (1)
352180832 dna-fingerprint-investigatory-project-class-12 (1)
 
Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...
 
Cbse computer science (c++) class 12 board project bank managment system
Cbse computer science (c++)  class 12 board project  bank managment systemCbse computer science (c++)  class 12 board project  bank managment system
Cbse computer science (c++) class 12 board project bank managment system
 
PYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEMPYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEM
 
Chemistry Practical File
Chemistry Practical FileChemistry Practical File
Chemistry Practical File
 

Similar to CSc investigatory project

Cs6301 programming and datastactures
Cs6301 programming and datastacturesCs6301 programming and datastactures
Cs6301 programming and datastacturesK.s. Ramesh
 
OOP-Advanced Programming with c++
OOP-Advanced Programming with c++OOP-Advanced Programming with c++
OOP-Advanced Programming with c++
Mohamed Essam
 
C++ & VISUAL C++
C++ & VISUAL C++ C++ & VISUAL C++
C++ & VISUAL C++
Makaha Rutendo
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
Praveen M Jigajinni
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
FellowBuddy.com
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
Ajay Chimmani
 
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScriptLotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
Bill Buchan
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
Rome468
 
Software_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxSoftware_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptx
ArifaMehreen1
 
Ch.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsCh.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objects
ITNet
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
Pranali Chaudhari
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Bill Buchan
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
Shipra Swati
 
Chapter1 introduction
Chapter1 introductionChapter1 introduction
Chapter1 introduction
Jeevan Acharya
 
C++Day-1 Introduction.ppt
C++Day-1 Introduction.pptC++Day-1 Introduction.ppt
C++Day-1 Introduction.ppt
citizen15
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
HouseMusica
 

Similar to CSc investigatory project (20)

Cs6301 programming and datastactures
Cs6301 programming and datastacturesCs6301 programming and datastactures
Cs6301 programming and datastactures
 
OOP-Advanced Programming with c++
OOP-Advanced Programming with c++OOP-Advanced Programming with c++
OOP-Advanced Programming with c++
 
C++ & VISUAL C++
C++ & VISUAL C++ C++ & VISUAL C++
C++ & VISUAL C++
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
 
Bp301
Bp301Bp301
Bp301
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
 
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScriptLotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
 
Software_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxSoftware_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptx
 
Ch.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsCh.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objects
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
 
Chapter1 introduction
Chapter1 introductionChapter1 introduction
Chapter1 introduction
 
C++Day-1 Introduction.ppt
C++Day-1 Introduction.pptC++Day-1 Introduction.ppt
C++Day-1 Introduction.ppt
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
 
Ad507
Ad507Ad507
Ad507
 

Recently uploaded

Seminar of U.V. Spectroscopy by SAMIR PANDA
 Seminar of U.V. Spectroscopy by SAMIR PANDA Seminar of U.V. Spectroscopy by SAMIR PANDA
Seminar of U.V. Spectroscopy by SAMIR PANDA
SAMIR PANDA
 
Orion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWSOrion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWS
Columbia Weather Systems
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
muralinath2
 
Viksit bharat till 2047 India@2047.pptx
Viksit bharat till 2047  India@2047.pptxViksit bharat till 2047  India@2047.pptx
Viksit bharat till 2047 India@2047.pptx
rakeshsharma20142015
 
platelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptxplatelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptx
muralinath2
 
filosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptxfilosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptx
IvanMallco1
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
Areesha Ahmad
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Sérgio Sacani
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
muralinath2
 
plant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptxplant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptx
yusufzako14
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
Sérgio Sacani
 
general properties of oerganologametal.ppt
general properties of oerganologametal.pptgeneral properties of oerganologametal.ppt
general properties of oerganologametal.ppt
IqrimaNabilatulhusni
 
Comparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratesComparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebrates
sachin783648
 
Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
kumarmathi863
 
GBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram StainingGBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram Staining
Areesha Ahmad
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
Lokesh Patil
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
AlaminAfendy1
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SELF-EXPLANATORY
 
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
Health Advances
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
Sérgio Sacani
 

Recently uploaded (20)

Seminar of U.V. Spectroscopy by SAMIR PANDA
 Seminar of U.V. Spectroscopy by SAMIR PANDA Seminar of U.V. Spectroscopy by SAMIR PANDA
Seminar of U.V. Spectroscopy by SAMIR PANDA
 
Orion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWSOrion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWS
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
 
Viksit bharat till 2047 India@2047.pptx
Viksit bharat till 2047  India@2047.pptxViksit bharat till 2047  India@2047.pptx
Viksit bharat till 2047 India@2047.pptx
 
platelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptxplatelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptx
 
filosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptxfilosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptx
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
 
plant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptxplant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptx
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
 
general properties of oerganologametal.ppt
general properties of oerganologametal.pptgeneral properties of oerganologametal.ppt
general properties of oerganologametal.ppt
 
Comparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratesComparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebrates
 
Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
 
GBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram StainingGBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram Staining
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
 
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 

CSc investigatory project

  • 1. COMPUTER SCIENCE INVESTIGATORY PROJECT TOPIC:- BANK MANAGEMENT SYSTEM BY DIVYANSHU KUMAR CLASS XII-A 2018-19
  • 2. KENDRIYA VIDYALAYA NO 2 NAUSENABAGH, VISAKHAPATNAM DEPARTMENT OF COMPUTER SCIENCE CERTIFICATE This is to certify that DIVYANSHU KUMAR of Class XII A has prepared the investigatory project entitled “BANK MANAGEMENT SYSTEM”. The project is the result of his efforts and endeavors. The report is found worthy of acceptance as final project report. He has prepared the report under my guidance.
  • 3. PGT (COMPUTER SCIENCE) D E C L A R A T I O N I hereby declare that the project work entitled “BANK MANAGEMENT SYSTEM”, submitted to Department of Computer Science, Kendriya Vidyalaya No. 2, Nausenabaugh, Visakhapatnam is prepared by me. DIVYANSHU KUMAR Class: XII A Cbse roll no-
  • 4. ACKNOWLEDGEMENT Through this acknowledgement I express my sincere gratitude to all those people who have been associated with the project and helped meto makeit a worthwhileexperience. Iextend my thanksto ourprincipal Mr.NishikantAggarwal and (PGTComputerScience) fortheir valuable guidance. I would like to express my gratitude towards my parents for their co-operation and encouragement which helped me to complete this project.
  • 6. INDEX 3. Intro. To Data File Handling 4. About The Program 5. Header File Used 6. Source Code 7. Output 8. Bibliography
  • 7. INTRODUCTION C++ is a statically typed, compiled, general purpose, case-sensitive, free- form programming language that supports procedural, object-oriented, and generic programming. C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features. C++ was developed by Bjarne Stroustrupstarting in 1979 at Bell Labs in Murray Hill, New Jersey as an enhancement to the C language and originally named C with Classes but later it was renamed C++ in 1983.C++ is a superset of C, and that virtually any legal C program is a legal C++ program. The most important thing to do when learning C++ is to focus on concepts and not get lost in language technical details. C++ is used by hundreds of thousands of programmers in essentially every application domain. C++ is being highly used to write device drivers and other software that rely on direct manipulation of hardware under real time constraints. C++ is widely used for teaching and research because it is cleaning enough for successful teaching of
  • 8. basic concepts. Anyone who has used either an apple Macintosh or a PC running windows has directly used C++ because the primary user interfaces of these systemare written in C++. INTRODUCTION TO OBJECT ORIENTED PROGRAMMING CONCEPTS Object Oriented Programming is a programming style that is associated with the concept of Class, Objects and various other concepts revolving around these two, like Inheritance, Polymorphism, Abstraction, Encapsulation etc. Basic OOPS concepts in c++ Here we will try to explain all the OOP concepts through this example and later we will have the technical definitons for all this. Class Here we can take Human Being as a class. A class is a blueprint for any functional entity which defines its properties and its functions. Like Human Being, having body parts, and performing various actions. Inheritance Considering HumanBeing a class, which has properties like hands, legs, eyes etc, and functions like walk, talk, eat, see etc. Male and Female are also classes, but most of the properties and
  • 9. functions are included in HumanBeing, hence they can inherit everything from class HumanBeing using the concept of Inheritance. Abstraction Abstraction means, showcasing only the required things to the outside world while hiding the details. Continuing our example, Human Being's can talk, walk, hear, eat, but the details are hidden from the outside world. We can take our skin as the Abstraction factor in our case, hiding the inside mechanism. Encapsulation This concept is a little tricky to explain with our example. Our Legs are binded to help us walk. Our hands, help us hold things. This binding of the properties to functions is called Encapsulation. Polymorphism Polymorphism is a concept, which allows us to redefine the way something works, by either changing how it is done or by changing the parts using which it is done. Both the ways have different terms for them. If we walk using our hands, and not legs, here we will change the parts used to perform something. Hence this is called Overloading. And if there is a defined way of walking, but I wish to walk differently, but using my legs, like everyone else. Then I can walk like I want, this will be called as Overriding. OOPS Concept Definitions
  • 10. Now, let us discuss some of the main features of Object Oriented Programming which you will be using in C++(technically). Objects Classes Abstraction Encapsulation Inheritance Overloading Exception Handling Objects Objects are the basic unit of OOP. They are instances of class, which have data members and uses various member functions to perform tasks. Class It is similar to structures in C language. Class can also be defined as user defined data type but it also contains functions in it. So, class is basically a blueprint for object. It declare & defines what data variables the object will have and what operations can be performed on the class's object. Abstraction
  • 11. Abstraction refers to showing only the essential features of the application and hiding the details. In C++, classes provide methods to the outside world to access & use the data variables, but the variables are hidden from direct access. This can be done access specifiers. Encapsulation It can also be said data binding. Encapsulation is all about binding the data variables and functions together in class. Inheritance Inheritance is a way to reuse once written code again and again. The class which is inherited is called base calls & the class which inherits is called derived class. So when, a derived class inherits a base class, the derived class can use all the functions which are defined in base class, hence making code reusable. It is a feature, which lets us create functions with same name but different arguments, which will perform differently. That is function with same name, functioning in different way. Or, it also allows us to redefine a function to provide its new definition. You will learn how to do this in details soon in coming lessons. Exception Handling Exception handling is a feature of OOP, to handle unresolved exceptions or errors produced at runtime from the outside world. We can take our skin as the Abstraction factor in our case, hiding the inside mechanism. INTRODUTION TO DATA FILE
  • 12. HANDLING Most computersprograms workwith files. This is because files help in storing information permanently. A fileis itselfa bunchofbytesstored onsome storagedevice like tape,or magnetic disk, etc. In C++, file input/outputfacilities are implemented throughacomponentheaderfile pf C++ standardlibrary. This headeris fstream.h. In C++, a file, atlowest level, is interpretedsimply as a sequence,or streamof bytes.One aspectof the file I/O library managesthetransferof thesebytes. The fstream library predefines a set of operations for handling file related input and output. It defines certain classes thathelpone performfile input andoutput.
  • 13. ABOUT THE PROGRAM The project “Bank Management System” has been developed as a very understandable Databaseof methods that can be created and handle easily. When you add a person acc. details to the database, the details is added automatically and settled in the binary file. The project aimed to create an easy database which can be handled and created easily. Generally, the database is being a master file that possessesthe tabular format of person’s acc. details, the sub menu for the account like acc. no. , deposit, name and menu option return.
  • 14. HEADER FILES USED IN PROGRAM  fstream.h – For file handling, cin, cout.  stdio.h – For standard I/O operations.  process.h – For exit() function.  iomanip.h – For setw() function.  conio.h – For clrscr() & getch() function.  ctype.h – For toupper() function.
  • 15. SOURCE CODE //*************************************************************** // HEADER FILE USED IN PROJECT //**************************************************************** #include<fstream.h> #include<ctype.h> #include<iomanip.h> #include<conio.h> #include<stdio.h> //*************************************************************** // CLASS USED IN PROJECT //**************************************************************** class account { int acno; char name[50]; int deposit; char type; public: void create_account(); //function to get data from user void show_account(); //function to show data on screen void modify(); //function to get new data from user void dep(int); //function to accept amount and add to balance amount void draw(int); //function to accept amount and subtract from balance amount void report(); //function to show data in tabular format int retacno(); //function to return account number
  • 16. int retdeposit(); //function to return balance amount char rettype(); //function to return type of account }; //class ends here void account::create_account() { cout<<"nEnter The account No."; cin>>acno; cout<<"nnEnter The Name of The account Holder : "; gets(name); cout<<"nEnter Type of The account (C/S) : "; cin>>type; type=toupper(type); cout<<"nEnter The Initial amount(>=500 for Saving and >=1000 for current ) : "; cin>>deposit; cout<<"nnnAccount Created.."; } void account::show_account() { cout<<"nAccount No. : "<<acno; cout<<"nAccount Holder Name : "; cout<<name; cout<<"nType of Account : "<<type; cout<<"nBalance amount : "<<deposit; } void account::modify() { cout<<"nThe account No."<<acno; cout<<"nnEnter The Name of The account Holder : "; gets(name); cout<<"nEnter Type of The account (C/S) : "; cin>>type; type=toupper(type); cout<<"nEnter The amount : "; cin>>deposit; } void account::dep(int x) { deposit+=x; } void account::draw(int x) { deposit-=x;
  • 17. } void account::report() { cout<<acno<<setw(10)<<" "<<name<<setw(10)<<" "<<type<<setw(6)<<deposit<<endl; } int account::retacno() { return acno; } int account::retdeposit() { return deposit; } char account::rettype() { return type; } //*************************************************************** // function declaration //**************************************************************** void write_account(); //function to write record in binary file void display_sp(int); //function to display account details given by user void modify_account(int); //function to modify record of file void delete_account(int); //function to delete record of file void display_all(); //function to display all account details void deposit_withdraw(int, int); // function to desposit/withdraw amount for given account void intro(); //introductory screen function //*************************************************************** // THE MAIN FUNCTION OF PROGRAM //**************************************************************** int main() { char ch; int num; clrscr(); intro(); do { clrscr();
  • 18. cout<<"nnntMAIN MENU"; cout<<"nnt01. NEW ACCOUNT"; cout<<"nnt02. DEPOSIT AMOUNT"; cout<<"nnt03. WITHDRAW AMOUNT"; cout<<"nnt04. BALANCE ENQUIRY"; cout<<"nnt05. ALL ACCOUNT HOLDER LIST"; cout<<"nnt06. CLOSE AN ACCOUNT"; cout<<"nnt07. MODIFY AN ACCOUNT"; cout<<"nnt08. EXIT"; cout<<"nntSelect Your Option (1-8) "; cin>>ch; clrscr(); switch(ch) { case '1': write_account(); break; case '2': cout<<"nntEnter The account No. : "; cin>>num; deposit_withdraw(num, 1); break; case '3': cout<<"nntEnter The account No. : "; cin>>num; deposit_withdraw(num, 2); break; case '4': cout<<"nntEnter The account No. : "; cin>>num; display_sp(num); break; case '5': display_all(); break; case '6': cout<<"nntEnter The account No. : "; cin>>num; delete_account(num); break; case '7': cout<<"nntEnter The account No. : "; cin>>num; modify_account(num); break; case '8': cout<<"nntThanks for using bank managemnt system"; break; default :cout<<"a"; } getch(); }while(ch!='8'); return 0; }
  • 19. //*************************************************************** // function to write in file //**************************************************************** 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(); } //*************************************************************** // function to read specific record from file //**************************************************************** void display_sp(int n) { account ac; int flag=0; ifstream inFile; inFile.open("account.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; return; } cout<<"nBALANCE DETAILSn"; while(inFile.read((char *) &ac, sizeof(account))) { if(ac.retacno()==n) { ac.show_account(); flag=1; } } inFile.close(); if(flag==0) cout<<"nnAccount number does not exist"; } //*************************************************************** // function to modify record of file //**************************************************************** void modify_account(int n)
  • 20. { 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 !! Press any Key..."; return; } while(File.read((char *) &ac, sizeof(account)) && found==0) { if(ac.retacno()==n) { ac.show_account(); cout<<"nnEnter 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<<"nnt Record Updated"; found=1; } } File.close(); if(found==0) cout<<"nn Record Not Found "; } //*************************************************************** // function to delete record of file //**************************************************************** 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 !! Press any Key..."; return; } outFile.open("Temp.dat",ios::binary); inFile.seekg(0,ios::beg); while(inFile.read((char *) &ac, sizeof(account))) { if(ac.retacno()!=n)
  • 21. { outFile.write((char *) &ac, sizeof(account)); } } inFile.close(); outFile.close(); remove("account.dat"); rename("Temp.dat","account.dat"); cout<<"nntRecord Deleted .."; } //*************************************************************** // function to display all accounts deposit list //**************************************************************** void display_all() { account ac; ifstream inFile; inFile.open("account.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; return; } cout<<"nnttACCOUNT HOLDER LISTnn"; cout<<"==================================================== n"; cout<<"A/c no. NAME Type Balancen"; cout<<"==================================================== n"; while(inFile.read((char *) &ac, sizeof(account))) { ac.report(); } inFile.close(); } //*************************************************************** // function to deposit and withdraw amounts //**************************************************************** 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)
  • 22. { cout<<"File could not be open !! Press any Key..."; return; } while(File.read((char *) &ac, sizeof(account)) && found==0) { if(ac.retacno()==n) { ac.show_account(); if(option==1) { cout<<"nntTO DEPOSITE AMOUNT "; cout<<"nnEnter The amount to be deposited : "; cin>>amt; ac.dep(amt); } if(option==2) { cout<<"nntTO WITHDRAW AMOUNT "; cout<<"nnEnter The amount to be withdraw : "; cin>>amt; int bal=ac.retdeposit()-amt; if((bal<500 && ac.rettype()=='S') || (bal<1000 && ac.rettype()=='C')) cout<<"Insufficience balance"; else ac.draw(amt); } int pos=(-1)* sizeof(ac); File.seekp(pos,ios::cur); File.write((char *) &ac, sizeof(account)); cout<<"nnt Record Updated"; found=1; } } File.close(); if(found==0) cout<<"nn Record Not Found "; } //*************************************************************** // INTRODUCTION FUNCTION //**************************************************************** void intro() { cout<<"nnnt BANK MANAGEMENT SYSTEM n"; cout<<"t -------------------------------";
  • 23. cout<<"nn MADE BY : DIVYANSHU & DEEPAK "; cout<<"nn SCHOOL : Kendriya Vidyalaya No.2,NSB,Vizag”; getch(); } //*************************************************************** // END OF PROJECT //*************************************************************** OUTPUT OF THE PROGRAM
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.