Hello there !
My name is Awais Qureshi. I am a well experience in the programming.
# include<iostream>
# include<string>
# include<stdlib.h>
using namespace std;
class bank{
protected:
// double balance;
string name;
int acctid;
char types;
string e_mail;
string password;
string mail;
string pass;
public:
int total;
double balance;
bank() //constructor
{
balance=0.00;
name="";
acctid=0;
total=0;
}
void signup()
{
cout<<"Enter your E-mial:"<<endl;
cin>>e_mail;
cout<<"Enter the password:"<<endl;
cin>>password;
cout<<"sign up successfully....."<<endl;
}
void login()
{
cout<<"Enter the E-mail:"<<endl;
cin>>mail;
cout<<"Enter the password:"<<endl;
cin>>password;
if(pass==password)
{
if(mail==e_mail)
{
cout<<"Your account login successfully..."<<endl;
}
else
{
cout<<"Your account do`t login:"<<endl;
}
}
else{
cout<<"Your account do`t login:"<<endl;
}
}
void create_Account()
{
while(true)
{
int choices;
cout<<"press 1 for sign up:"<<endl;
cout<<"Press 2 for login:"<<endl;
cout<<"press 3 If already account created :"<<endl;
cout<<"press 4 for exit:"<<endl;
cin>>choices;
if(choices==1)
{
signup();
}
else if(choices==2)
{
login();
}
else
{
exit(0);
}
}
cout<<"how many account you want to create::"<<endl;
cin>>total;
for(int i=1;i<=total;i++)
{
cout<<"Account ::"<<i<<endl;
cout<<"Enter the information:: "<<endl;
cout<<"Enter the name :: "<<endl;
cin>>name;
cout<<"Enter the account id::"<<endl;
cin>>acctid;
cout<<"Enter the Account types(s/c):"<<endl;
cin>>types;
cout<<"Enter the initial balance amount ::"<<endl;
cin>>balance;
cout<<"Account created..."<<endl;
// total++;
// case '4':
// {
// exit(0);
// }
}
}
void show()
{
double a;
cout<<"Enter the account id ::"<<endl;
cin>>a;
if(a==acctid)
{
cout<<"Your name is ::"<<name<<endl;
cout<<"Accouont id is::"<<acctid<<endl;
cout<<"Account types ::"<<types<<endl;
cout<<"Total balance ::"<<balance<<endl;
}
else{
cout<<"Account not found::"<<endl;
}
}
void close_account()
{
balance=0.00;
name="";
acctid=0;
cout<<"Account is deleted......"<<endl;
}
void modify_account()
{
double b;
cout<<"Enter the Account id::"<<endl;
cin>>b;
if(b==acctid)
{
cout<<"Previous information ::"<<endl;
cout<<"Your name is ::"<<name<<endl;
cout<<"Accouont id is::"<<acctid<<endl;
cout<<"Total balance ::"<<endl;
cout<<"\tEnter the new information ::"<<endl;
cout<<"Enter the name :: "<<endl;
cin>>name;
cout<<"Enter the account id::"<<endl;
cin>>acctid;
cout<<"Enter the balance ::"<<endl;
cin>>balance;
cout<<" Modify Account ..."<<endl;
}
else
{
cout<<"Account is not found:: "<<endl;
}
}
};
class account:public bank{
double withdraw;
int x;
int y;
public:
double amount;
account()
{
amount =0;
withdraw=0;
x=0;
y=0;
}
void deposite_amount()
{
// int x;
cout<<"Enter the account id:: "<<endl;
cin>>x;
if(x=acctid)
{
cout<<"Your name is ::"<<name<<endl;
cout<<"Accouont id is::"<<acctid<<endl;
cout<<"Account types ::"<<types<<endl;
cout<<"Total balance ::"<<balance<<endl;
cout<<"Enter the amount you want to deposit::"<<endl;
cin>>amount;
}
else
{
cout<<"invalied account id ::"<<endl;
}
}
void calculate()
{
balance+=amount;
cout<<"Total balance ::"<<balance<<endl;
}
void withdraw_amount()
{
cout<<"Enter the account id in which account you want to withdraw:: "<<endl;
cin>>y;
if(acctid==y)
{
cout<<"Your name is ::"<<name<<endl;
cout<<"Accouont id is::"<<acctid<<endl;
cout<<"Account types ::"<<types<<endl;
cout<<"Total balance ::"<<balance<<endl;
cout<<"Enter the amount you want to withdraw ::"<<endl;
cin>>withdraw;
balance-=withdraw;
cout<<"Balance after withdraw ::"<<balance<<endl;
}
else
{
cout<<"Invalied input account id:: "<<endl;
}
}
void account_holder()
{
cout<<"==========================================="<<endl;
cout<<"Name :"<<"\t account id:"<<"\ttypes"<<"\t balance"<<endl;
cout<<name<<"\t\t"<<acctid<<"\t"<<types<<"\t"<<balance<<endl;
cout<<"==========================================="<<endl;
}
};
int main()
{
bank b;
account a;
char ch;
int num;
while (true)
{
//system("CLS");
cout<<"\n\n\t\t\t\t======================\n";
cout<<"\t\t\t\tBANK MANAGEMENT SYSTEM";
cout<<"\n\t\t\t\t======================\n";
cout<<"\t\t\t\t ::MAIN MENU::\n";
cout<<"\n\t\t\t\t1. SIGN UP:";
cout<<"\n\t\t\t\t2. LOGIN:";
cout<<"\n\t\t\t\t3. NEW ACCOUNT";
cout<<"\n\t\t\t\t4. DEPOSIT AMOUNT";
cout<<"\n\t\t\t\t5. WITHDRAW AMOUNT";
cout<<"\n\t\t\t\t6. BALANCE ENQUIRY";
cout<<"\n\t\t\t\t7. ALL ACCOUNT HOLDER LIST";
cout<<"\n\t\t\t\t8. CLOSE AN ACCOUNT";
cout<<"\n\t\t\t\t9. MODIFY AN ACCOUNT";
cout<<"\n\t\t\t\t10. EXIT";
cout<<"\n\n\t\t\t\tSelect Your Option (1-10): ";
cin>>ch;
switch(ch)
{
case '1':
{
a.signup();
break;
}
case '2':
{
a.login();
}
case '3':
{
// system("CLS");
a.create_Account() ;
break;
}
case'4':
{
a.deposite_amount();
a.calculate();
break;
}
case '5':
{
a.withdraw_amount();
break;
}
case'6':
{
// system("CLS");
a.show();
break;
}
case '7':
{
a.account_holder();
break;
}
case '8':
{
a.close_account();
break;
}
case '9':
{
a.modify_account();
break;
}
// case '10':
// {
// exit(0);
// }
default:
{
exit(0);
cout<<"Select right option ::"<<endl;
cout<<"invalid input number ::"<<endl;
}
}
}
return 0;
}