Report Mini Project Final Draft
Report Mini Project Final Draft
GROUP MEMBERS:-
Vaidant Jain:- [Roll no:- 104042, PRN:-1032221672]
Shivain Rajput:- [Roll no:- 104060, PRN:-1032221704]
Gaurav Mishra:- [Roll no:- 104056, PRN:-1032221713]
Pratham Shrivastava:- [Roll no:- 104071, PRN:-1032221624]
Siddhi Salunkhe:- [Roll no:- 104099, PRN:-1032222152]
Problem Statement:-
To create a Banking management system using the fundamental
concepts of Object Oriented Programming in C++.
Introduction:-
This Banking management system is a simple text based C++
program where we have used the fundamental concepts of Object
Oriented Programming in C++ such as file handling, class
inheritance, etc. using which we have made an efficient & smart way
of storing bank data such as account details, money in accounts
,updation of accounts , etc.
Motivation:-
The Bank Management System is a web-based application and its
main motive is to build an organic and optimal interaction system
between the elements of banking mechanisms with a view to profit.
With the help of this system , users can perform all the tasks like
creating an account, deposit amount, check balance, view all account
holder details, close an account and modify an account easily. The
purpose of this system is to automate basic banking activities to aid
a bank clerk’s day to day operations.
Individual Contribution:-
Vaidant Jain:- New_bank account, Deposit Money
Shivain Rajput:- Withdraw Money
Gaurav Mishra:- Close an account, Update an account
Pratham Shrivastava:- Display all account
Siddhi Salunkhe:- Display account
Function modules:-
● create_Bank_Account(): It will take input account number,
name, type of account and opening balance.
● Display_Account(): It will display the account details such as
account number, name, account type and balance.
● Updation(): It will update the account details such as name,
account type and total balance.
● retacno(): It will return the account number of the desired
account.
● rettype(): It will return the account type of the desired
account.
● dep(int): It will deposit the given amount in the account.
● draw(int): It will withdraw the given amount from the
account.
● Flowchart:
Code:-
/* MINI PROJECT: Implementation of Banking Management System.
Demonstrating the concepts of OOP in C++
Author: Vaidant Jain, Gaurav Mishra, Shivain Rajput, Pratham Shrivastava,
Siddhi Salunkhe
Roll No.: 104042, 104056, 104060, 104071, 104099
Class: Division 4
*/
// Start of CPP program
#include<iostream>
#include<fstream>
#include<cctype>
#include<iomanip>
using namespace std;
class account
{
int Money_Deposit;
char type;
int acno;
char name[70];
public:
void account::Updation()
{
cout<<"\n\tBank_Account No. : "<<acno;
cout<<"\n\tUpdation Bank Account Holder Name : ";
cin.ignore();
cin.getline(name,50);
cout<<"\n\tUpdation Type of Bank Account : ";
cin>>type;
type=toupper(type);
cout<<"\n\tUpdation Balance Total-Money : ";
cin>>Money_Deposit;
}
void account::create_Bank_Account()
{
system("CLS");
cout<<"\n\tPlease Enter the Bank_Account No. : ";
cin>>acno;
cout<<"\n\n\tPlease Enter the Name of the Bank Account holder : ";
cin.ignore();
cin.getline(name,50);
cout<<"\n\tPlease Enter Type of the Bank Account (C/S) : ";
cin>>type;
type=toupper(type);
cout<<"\n\tPlease Enter The Starting Total-Money : ";
cin>>Money_Deposit;
cout<<"\n\n\tBank_Account Created..";
}
void write_Bank_Account();
void display_acc(int);
void display_all();
void delete_Bank_Account(int);
void Money_Deposit_withdraw(int, int);
void Updation_Bank_Account(int);
void write_Bank_Account()
{
account ac;
ofstream outFile;
outFile.open("Bank_Account.dat",ios::binary|ios::app);
ac.create_Bank_Account();
outFile.write(reinterpret_cast<char *> (&ac), sizeof(account));
outFile.close();
}
void delete_Bank_Account(int n)
{
account ac;
ifstream inFile;
ofstream outFile;
inFile.open("Bank_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("Bank_Account.dat");
rename("Temp.dat","Bank_Account.dat");
cout<<"\n\nRecord Deleted ..";
}
void display_acc(int n)
{
account ac;
bool flag=false;
ifstream inFile;
inFile.open("Bank_Account.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
return;
}
cout<<"\n\tBALANCE DETAILS\n";
while(inFile.read(reinterpret_cast<char *> (&ac),
sizeof(account)))
{
if(ac.retacno()==n)
{
ac.Display_Account();
flag=true;
}
}
inFile.close();
if(flag==false)
cout<<"\n\n\tBank Account number does not exist";
}
void display_all()
{
account ac;
ifstream inFile;
inFile.open("Bank_Account.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
return;
}
cout<<"\n\n\t\tBank_Account 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();
}
void Updation_Bank_Account(int n)
{
bool found=false;
account ac;
fstream File;
File.open("Bank_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.Display_Account();
cout<<"\n\n\tPlease Enter The New Details of Bank
Account"<<endl;
ac.Updation();
int pos=(-1)*static_cast<int>(sizeof(account));
File.seekp(pos,ios::cur);
File.write(reinterpret_cast<char *> (&ac), sizeof(account));
cout<<"\n\n\tRecord Updated";
found=true;
}
}
File.close();
if(found==false)
cout<<"\n\n\tRecord Not Found ";
}
switch(ch)
{
case '1':
write_Bank_Account();
break;
case '2':
cout<<"\n\n\tPlease Enter The Bank Account No. : "; cin>>num;
Money_Deposit_withdraw(num, 1);
break;
case '3':
cout<<"\n\n\tPlease Enter The Bank Account No. : "; cin>>num;
Money_Deposit_withdraw(num, 2);
break;
case '4':
cout<<"\n\n\tPlease Enter The Bank Account No. : "; cin>>num;
display_acc(num);
break;
case '5':
display_all();
break;
case '6':
cout<<"\n\n\tPlease Enter The Bank Account No. : "; cin>>num;
delete_Bank_Account(num);
break;
case '7':
cout<<"\n\n\tPlease Enter The Bank Account No. : "; cin>>num;
Updation_Bank_Account(num);
break;
case '8':
cout<<"\n\n Exiting the program ";
break;
default :cout<<"\a";
}
cin.ignore();
cin.get();
}while(ch!='8');
return 0;
}
Conclusion:-
Using this application we can successfully implement all the features
of banking management.
References:-
● https://www.geeksforgeeks.org/file-handling-c-classes/
● https://www.tutorialspoint.com/cpp_standard_library/iomani
p.htm
● https://cplusplus.com/reference/cctype/
● https://www.geeksforgeeks.org/const-member-functions-c/
● https://www.geeksforgeeks.org/reinterpret_cast-in-c-type-cas
ting-operators/
● https://www.simplilearn.com/tutorials/cpp-tutorial/setw-cpp