Beruflich Dokumente
Kultur Dokumente
MANAGEMENT
SYSTEM
1
Bank Management System
1.AIM
This program aim is to get the money in the atm with
safety
2.Introduction To C++
C++ is a general-purpose programming language that was developed by Bjarne
Stroustrup as an extension of the C language, or "C with Classes". It
has imperative, object-oriented and generic programming features, while also
providing facilities for low-level memory manipulation. It is almost always
implemented as a compiled language, and many vendors provide C++ compilers,
including the Free Software Foundation, Microsoft, Intel, and IBM, so it is available
on many platforms.
C++ was designed with a bias toward system programming and embedded, resource-
constrained software and large systems, with performance, efficiency and flexibility
of use as its design highlights. C++ has also been found useful in many other contexts,
with key strengths being software infrastructure and resource-constrained
applications, including desktop applications, servers (e.g. e-commerce, Web
search or SQL servers), and performance-critical applications (e.g. telephone
switches or space probes).
C++ is standardized by the International Organization for Standardization (ISO), with
the latest standard version ratified and published by ISO in December 2017
as ISO/IEC 14882:2017 (informally known as C++17).The C++ programming
language was initially standardized in 1998 as ISO/IEC 14882:1998, which was then
amended by the C++03, C++11 and C++14 standards. The current C++17 standard
supersedes these with new features and an enlarged standard library. Before the initial
standardization in 1998, C++ was developed by Danish computer scientist Bjarne
Stroustrup at Bell Labs since 1979 as an extension of the C language; he wanted an
efficient and flexible language similar to C that also provided high-level features for
program organization. C++20 is the next planned standard, keeping with the current
trend of a new version every three year.
2
3.History
3
became the basis for the future standard. Later feature additions
included templates, exceptions, namespaces, new casts, and a boolean type.
After the 2.0 update, C++ evolved relatively slowly until, in 2011, the C++11 standard
was released, adding numerous new features, enlarging the standard library further,
and providing more facilities to C++ programmers. After a minor C++14 update
released in December 2014, various new additions were introduced in C++17, and
further changes planned for 2020.
As of 2017, C++ remains the third most popular programming language,
behind Java and C.
On January 3, 2018, Stroustrup was announced as the 2018 winner of the Charles
Stark Draper Prize for Engineering, "for conceptualizing and developing the C++
programming language".
4.Etymology
According to Stroustrup: "the name signifies the evolutionary nature of the changes
from C".This name is credited to Rick Mascitti (mid-1983) and was first used in
December 1983. When Mascitti was questioned informally in 1992 about the naming,
he indicated that it was given in a tongue-in-cheek spirit. The name comes from
C's ++ operator (which increments the value of a variable) and a common naming
convention of using "+" to indicate an enhanced computer program.
During C++'s development period, the language had been referred to as "new C" and
"C with Classes" before acquiring its final name.
5.Philosophy
Throughout C++'s life, its development and evolution has been guided by a set of
principles:
It must be driven by actual problems and its features should be immediately useful
in real world programs.
Every feature should be implementable (with a reasonably obvious way to do so).
Programmers should be free to pick their own programming style, and that style
should be fully supported by C++.
Allowing a useful feature is more important than preventing every possible misuse
of C++.
It should provide facilities for organising programs into separate, well-defined
parts, and provide facilities for combining separately developed parts.
No implicit violations of the type system (but allow explicit violations; that is,
those explicitly requested by the programmer).
4
User-created types need to have the same support and performance as built in
types.
Unused features should not negatively impact created executables (e.g. in lower
performance).
There should be no language beneath C++ (except assembly language).
C++ should work alongside other existing programming languages, rather than
fostering its own separate and incompatible programming environment.
If the programmer's intent is unknown, allow the programmer to specify it by
providing manual control.
6.Standardization
C++ is standardized by an ISO working group known as JTC1/SC22/WG21. So far, it
has published five revisions of the C++ standard and is currently working on the next
revision, C++20.
In 1998, the ISO working group standardized C++ for the first time as ISO/IEC
14882:1998, which is informally known as C++98. In 2003, it published a new
version of the C++ standard called ISO/IEC 14882:2003, which fixed problems
identified in C++98.
The next major revision of the standard was informally referred to as "C++0x", but it
was not released until 2011. C++11(14882:2011) included many additions to both the
core language and the standard library.
In 2014, C++14 (also known as C++1y) was released as a small extension to C++11,
featuring mainly bug fixes and small improvements. The Draft International Standard
ballot procedures completed in mid-August 2014.
After C++14, a major revision C++17, informally known as C++1z, was completed
by the ISO C++ Committee in mid July 2017 and was approved and published in
December 2017.
As part of the standardization process, ISO also publishes technical reports and
specifications:
5
7.HEADER FILE USED IN PROJECT
#include<iostream>
#include<fstream>
#include<cctype>
#include<iomanip>
using namespace std;
class account
{
int acno;
char name[50];
int deposit;
char type;
public:
void create_account(); //function to get data from user
void show_account() const; //function to show data on screen
void modify(); //function to add new data
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() const; //function to show data in tabular format
int retacno() const; //function to return account number
int retdeposit() const; //function to return balance amount
char rettype() const; //function to return type of account
}; //class ends here
void account::create_account()
{
cout<<"\nEnter The account No. :";
cin>>acno;
cout<<"\n\nEnter The Name of The account Holder : ";
cin.ignore();
cin.getline(name,50);
6
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<<"\n\n\nAccount Created..";
}
void account::modify()
{
cout<<"\nAccount No. : "<<acno;
cout<<"\nModify Account Holder Name : ";
cin.ignore();
cin.getline(name,50);
cout<<"\nModify Type of Account : ";
cin>>type;
type=toupper(type);
cout<<"\nModify Balance amount : ";
cin>>deposit;
}
void account::dep(int x)
{
deposit+=x;
}
void account::draw(int x)
{
deposit-=x;
7
}
9.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);
void intro();
8
int main()
{
char ch;
int num;
intro();
do
{
system("cls");
cout<<"\n\n\n\tMAIN MENU";
cout<<"\n\n\t01. NEW ACCOUNT";
cout<<"\n\n\t02. DEPOSIT AMOUNT";
cout<<"\n\n\t03. WITHDRAW AMOUNT";
cout<<"\n\n\t04. BALANCE ENQUIRY";
cout<<"\n\n\t05. ALL ACCOUNT HOLDER LIST";
cout<<"\n\n\t06. CLOSE AN ACCOUNT";
cout<<"\n\n\t07. MODIFY AN ACCOUNT";
cout<<"\n\n\t08. EXIT";
cout<<"\n\n\tSelect Your Option (1-8) ";
cin>>ch;
system("cls");
switch(ch)
{
case '1':
write_account();
break;
case '2':
cout<<"\n\n\tEnter The account No. : "; cin>>num;
deposit_withdraw(num, 1);
break;
case '3':
cout<<"\n\n\tEnter The account No. : "; cin>>num;
deposit_withdraw(num, 2);
break;
case '4':
cout<<"\n\n\tEnter The account No. : "; cin>>num;
display_sp(num);
break;
case '5':
display_all();
break;
case '6':
9
cout<<"\n\n\tEnter The account No. : "; cin>>num;
delete_account(num);
break;
case '7':
cout<<"\n\n\tEnter The account No. : "; cin>>num;
modify_account(num);
break;
case '8':
cout<<"\n\n\tThanks for using bank managemnt system";
break;
default :cout<<"\a";
}
cin.ignore();
cin.get();
}while(ch!='8');
return 0;
}
void write_account()
{
account ac;
ofstream outFile;
outFile.open("account.dat",ios::binary|ios::app);
ac.create_account();
outFile.write(reinterpret_cast<char *> (&ac), sizeof(account));
outFile.close();
}
void display_sp(int n)
{
account ac;
bool flag=false;
ifstream inFile;
inFile.open("account.dat",ios::binary);
if(!inFile)
{
10
cout<<"File could not be open !! Press any Key...";
return;
}
cout<<"\nBALANCE DETAILS\n";
void modify_account(int n)
{
bool found=false;
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.eof() && found==false)
{
File.read(reinterpret_cast<char *> (&ac), sizeof(account));
if(ac.retacno()==n)
{
ac.show_account();
cout<<"\n\nEnter The New Details of account"<<endl;
11
ac.modify();
int pos=(-1)*static_cast<int>(sizeof(account));
File.seekp(pos,ios::cur);
File.write(reinterpret_cast<char *> (&ac), sizeof(account));
cout<<"\n\n\t Record Updated";
found=true;
}
}
File.close();
if(found==false)
cout<<"\n\n Record 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 !! Press any Key...";
return;
}
outFile.open("Temp.dat",ios::binary);
inFile.seekg(0,ios::beg);
while(inFile.read(reinterpret_cast<char *> (&ac), sizeof(account)))
{
if(ac.retacno()!=n)
{
outFile.write(reinterpret_cast<char *> (&ac),
sizeof(account));
}
}
inFile.close();
outFile.close();
remove("account.dat");
rename("Temp.dat","account.dat");
12
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 !! Press any Key...";
return;
}
cout<<"\n\n\t\tACCOUNT HOLDER LIST\n\n";
cout<<"=================================================
===\n";
cout<<"A/c no. NAME Type Balance\n";
cout<<"=================================================
===\n";
while(inFile.read(reinterpret_cast<char *> (&ac), sizeof(account)))
{
ac.report();
}
inFile.close();
}
13
if(!File)
{
cout<<"File could not be open !! Press any Key...";
return;
}
while(!File.eof() && found==false)
{
File.read(reinterpret_cast<char *> (&ac), sizeof(account));
if(ac.retacno()==n)
{
ac.show_account();
if(option==1)
{
cout<<"\n\n\tTO DEPOSITE AMOUNT ";
cout<<"\n\nEnter The amount to be deposited";
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<<"Insufficience balance";
else
ac.draw(amt);
}
int pos=(-1)*static_cast<int>(sizeof(ac));
File.seekp(pos,ios::cur);
File.write(reinterpret_cast<char *> (&ac), sizeof(account));
cout<<"\n\n\t Record Updated";
found=true;
}
}
File.close();
if(found==false)
cout<<"\n\n Record Not Found ";
}
14
17.Output
15
16
17
18
18. BIBLOGRAPHY
http://www.cppforschool.com/project/banking-system-project.html
19