Earn Money Using Wahtsapp and Facebook
C++ Bank Project
#include<iostream>
#include<conio.h>
using namespace std;
class Bank{
private:
char name[30];
char accname[20];
char type[20];
int ibalance;
int dep;
int with;
public:
void menu(void);
void deposite(void);
void get(void);
void check(void);
void withdraw(void);
void info(void);
};
void Bank::menu()
{
int me;
cout<<"\t|-----------------------------|"<<endl;
cout<<"\t|-----------------------------|"<<endl;
cout<<"\t|Enter the number from 1-to-5 |"<<endl;
cout<<"\t|-----------------------------|"<<endl;
cout<<"\t|-----------------------------|"<<endl;
//cout<<"\n\n"<<endl;
cout<<"\t\t1.Create New account"<<endl;
cout<<"\t\t2.Deposit Balance"<<endl;
cout<<"\t\t3.Check your Balance"<<endl;
cout<<"\t\t4.Withdraw Money"<<endl;
cout<<"\t\t5.Yours ACcount Information"<<endl;
// cout<<"\t\t6.exit"<<endl;
cout<<"=============================="<<endl;
cin>>me;
switch(me)
{
case 1:
get();
break;
case 2:
deposite();
break;
case 3:
check();
break;
case 4:
withdraw();
break;
case 5:
info();
break;
}
}
void Bank::get()
{
int go;
cout<<"\t\tEnter Your Name"<<endl;
cin>>name;
cout<<"\t\tEnter Account Name"<<endl;
cin>>accname;
cout<<"\t\tEnter Account Type"<<endl;
cin>>type;
cout<<"\t\tEnter Balance You Want To Deposit?"<<endl;
cin>>ibalance;
cout<<"\t\tHit '0' for goto main menu"<<endl;
cin>>go;
if
(go==0)
{
menu();
}
else
cout<<"|-------------|"<<endl;
cout<<"|Invalid Input|"<<endl;
cout<<"|-------------|"<<endl;
}
void Bank::deposite()
{
int go;
cout<<"\tEnter Amount you want to deposit"<<endl;
cin>>dep;
dep+=ibalance;
cout<<"\tHit '0' to goto menu"<<endl;
cin>>go;
if(go==0)
{
menu();
}
}
void Bank::check()
{
int go;
cout<<"|----------------------------------------|"<<endl;
cout<<"|Your Current Balance is = "<<dep<<endl;
cout<<"|----------------------------------------|"<<endl;
cout<<"\t\tHit '0' to goto menu"<<endl;
cin>>go;
if(go==0)
{
menu();
}
}
void Bank::withdraw()
{
int go;
cout<<"\t\t\tEnter Amount You want to withdraw?"<<endl;
cin>>with;
dep-=with;
cout<<"Press '0' to goto main menu"<<endl;
if(go==0)
{
menu();
}
}
void Bank::info()
{
int go;
cout<<"------------------------------------------"<<endl;
cout<<"__________________________________________"<<endl;
cout<<"\tThe Name of account holder is "<<name<<endl;
cout<<"------------------------------------------"<<endl;
cout<<"\tThe Name of account is "<<accname<<endl;
cout<<"------------------------------------------"<<endl;
cout<<"\tThe Type of account is "<<type<<endl;
cout<<"------------------------------------------"<<endl;
cout<<"\tCurrent Account Balance is "<<dep<<endl;
cout<<"------------------------------------------"<<endl;
cout<<"------------------------------------------"<<endl;
cout<<"__________________________________________"<<endl;
cout<<"------------------------------------------"<<endl;
cout<<"\tHit '0' to goto menu"<<endl;
cout<<"------------------------------------------"<<endl;
cin>>go;
if(go==0)
{
menu();
}
}
int main()
{
Bank obj;
obj.menu();
obj.deposite();
getch();
return 0;
}
No comments:
Post a Comment