Bank Management System
Bank Management System
#include<iostream>
#include<string.h>
#include<string>
#include<cstring>
#include<conio.h>
#include<stdio.h>
using namespace std;
class BankAccount
{
private:
string name;
string account;
string type;
double balance;
string id;
public:
BankAccount()
{
}
BankAccount(string nam,string acc,string typ,double balan,string iden)
{
name=nam;
account=acc;
type=typ;
balance=balan;
id=iden;
}
void setname(string nam)
{
name=nam;
}
void setaccount(string accnt)
{
account=accnt;
}
void settype(string typ)
{
type=typ;
}
void setbalance(double balan)
{
balance=balan;
}
void setid(string iden)
{
id=iden;
}
string getname()
{
return name;
}
string getaccount()
{
return account;
}
string gettype()
{
return type;
}
double getbalance()
{
return balance;
}
string getid()
{
return id;
}
void show()
{
cout<<"YOUR DATA FOUND "<<endl<<endl<<endl;
cout<<"YOUR ACCOUNT TYPE IS "<<type<<endl;
cout<<"Your name is "<<name<<endl;
cout<<"Your account number is "<<account<<endl;
cout<<"YOUR CURRENT BALANCE IS "<<balance<<endl;
}
void deposit()
{ double dep;
cout<<"HOW MUCH AMOUNT YOU WANT TO DEPOSIT MORE "<<endl;
cin>>dep;
balance=balance + dep;
//setbalance(balance);
cout<<" NOW YOUR BALANCE IS UPDATED TO ";
cout<<getbalance();
}
void withdraw()
{
double amount;
cout<<"HOW MUCH AMOUNT YOU WANT TO WITHDRAW "<<endl;
cin>>amount;
balance=balance-amount;
setbalance(balance);
cout<<" NOW YOUR REMAINING BALANCE IS "<<getbalance()<<endl;
if(amount>getbalance())
{
cout<<"You Do Not Have That Much Balance Try Again "<<endl;
system("CLS");
}
}
};
BankAccount create();
int main()
{
string ident;
int choice,y,i,j,sel,m=2,k;
int index=0;
char select;
BankAccount account[10];
BankAccount ban;
system("CLS");
for(k=0;k<m;k++)
{
cout<<"If You Are A New Member Create New Account Else Proceed To Other Menu "<<endl;
cout<<"1-Create New Account "<<endl;
cout<<"2-Proceed Further For Other Menu "<<endl;
cin>>sel;
switch(sel)
{
case 1:
cout<<"How Many Accounts You Want To Create ? "<<endl;
cin>>y;
for(i=0;i<y;i++)
{
create();
account[index]=create();
index++;
}
break;
case 2:
cout<<"Enter Your Identity To Enter the Menu "<<endl;
cin>>ident;
for(j=0;j<10;j++)
{
if(ident==account[j].getid())
{
account[j].show();
break;
}
else
cout<<"sorry Your Data Not Found "<<endl;
break;
}
cout<<endl<<endl<<endl;
cout<<"1-SHOW STATUS"<<endl;
cout<<"2-DEPOSIT AMOUNT"<<endl;
cout<<"3-WITHDRAW AMOUNT"<<endl;
cin>>choice;
switch(choice)
{
/*case 1:
cout<<"How Many Accounts You Want To Create ? "<<endl;
cin>>y;
for(i=0;i<y;i++)
{
BankAccount create();
account[index]=create();
index++;
}
break;*/
case 1:
account[j].show();
break;
case 2:
account[j].deposit();
break;
case 3:
account[j].withdraw();
break;
cout<<endl;
cout<<"Do you want to Continue (Y/N) ? "<<endl;
cin>>select;
}
}
}
return 0;
}
BankAccount create()
{
string name,type,account,identity;
double balance;
cout<<endl;
system("CLS");
cout<<"Enter Your Name"<<endl;
cin>>name;
cout<<endl;
cout<<"Enter Type Of Account"<<endl;
cin>>type;
cout<<endl;
cout<<"Enter IDENTITY FOR THE SECURITY OF YOUR ACCOUNT"<<endl;
cin>>identity;
cout<<endl;
cout<<"Select Your Account Number"<<endl;
cin>>account;
cout<<endl;
cout<<"How Much Amount You Want To Deposit "<<endl;
cin>>balance;
cout<<endl;
BankAccount ban(name,account,type,balance,identity);
return ban;
}
#include<iostream>
#include<string.h>
#include<string>
#include<cstring>
#include<conio.h>
#include<stdio.h>
using namespace std;
class BankAccount
{
private:
string name;
string account;
string type;
double balance;
string id;
public:
BankAccount()
{
}
BankAccount(string nam,string acc,string typ,double balan,string iden)
{
name=nam;
account=acc;
type=typ;
balance=balan;
id=iden;
}
void setname(string nam)
{
name=nam;
}
void setaccount(string accnt)
{
account=accnt;
}
void settype(string typ)
{
type=typ;
}
void setbalance(double balan)
{
balance=balan;
}
void setid(string iden)
{
id=iden;
}
string getname()
{
return name;
}
string getaccount()
{
return account;
}
string gettype()
{
return type;
}
double getbalance()
{
return balance;
}
string getid()
{
return id;
}
void show()
{
cout<<"YOUR DATA FOUND "<<endl<<endl<<endl;
cout<<"YOUR ACCOUNT TYPE IS "<<type<<endl;
cout<<"Your name is "<<name<<endl;
cout<<"Your account number is "<<account<<endl;
cout<<"YOUR CURRENT BALANCE IS "<<balance<<endl;
}
void deposit()
{ double dep;
cout<<"HOW MUCH AMOUNT YOU WANT TO DEPOSIT MORE "<<endl;
cin>>dep;
balance=balance + dep;
//setbalance(balance);
cout<<" NOW YOUR BALANCE IS UPDATED TO ";
cout<<getbalance();
}
void withdraw()
{
double amount;
cout<<"HOW MUCH AMOUNT YOU WANT TO WITHDRAW "<<endl;
cin>>amount;
balance=balance-amount;
setbalance(balance);
cout<<" NOW YOUR REMAINING BALANCE IS "<<getbalance()<<endl;
if(amount>getbalance())
{
cout<<"You Do Not Have That Much Balance Try Again "<<endl;
system("CLS");
}
}
};
BankAccount create();
int main()
{
string ident;
int choice,y,i,j,sel,m=2,k;
int index=0;
char select;
BankAccount account[10];
BankAccount ban;
system("CLS");
for(k=0;k<m;k++)
{
cout<<"If You Are A New Member Create New Account Else Proceed To Other Menu "<<endl;
cout<<"1-Create New Account "<<endl;
cout<<"2-Proceed Further For Other Menu "<<endl;
cin>>sel;
switch(sel)
{
case 1:
cout<<"How Many Accounts You Want To Create ? "<<endl;
cin>>y;
for(i=0;i<y;i++)
{
create();
account[index]=create();
index++;
}
break;
case 2:
cout<<"Enter Your Identity To Enter the Menu "<<endl;
cin>>ident;
for(j=0;j<10;j++)
{
if(ident==account[j].getid())
{
account[j].show();
break;
}
else
cout<<"sorry Your Data Not Found "<<endl;
break;
}
cout<<endl<<endl<<endl;
cout<<"1-SHOW STATUS"<<endl;
cout<<"2-DEPOSIT AMOUNT"<<endl;
cout<<"3-WITHDRAW AMOUNT"<<endl;
cin>>choice;
switch(choice)
{
/*case 1:
cout<<"How Many Accounts You Want To Create ? "<<endl;
cin>>y;
for(i=0;i<y;i++)
{
BankAccount create();
account[index]=create();
index++;
}
break;*/
case 1:
account[j].show();
break;
case 2:
account[j].deposit();
break;
case 3:
account[j].withdraw();
break;
cout<<endl;
cout<<"Do you want to Continue (Y/N) ? "<<endl;
cin>>select;
}
}
}
return 0;
}
BankAccount create()
{
string name,type,account,identity;
double balance;
cout<<endl;
system("CLS");
cout<<"Enter Your Name"<<endl;
cin>>name;
cout<<endl;
cout<<"Enter Type Of Account"<<endl;
cin>>type;
cout<<endl;
cout<<"Enter IDENTITY FOR THE SECURITY OF YOUR ACCOUNT"<<endl;
cin>>identity;
cout<<endl;
cout<<"Select Your Account Number"<<endl;
cin>>account;
cout<<endl;
cout<<"How Much Amount You Want To Deposit "<<endl;
cin>>balance;
cout<<endl;
BankAccount ban(name,account,type,balance,identity);
return ban;
}