#include<iostream>
#include<conio.h>
using namespace std;
//Class Bank
class bank
{
private:
char name_of_depositor[20];
long account_number;
char type_of_acount[20];
double balance_in_account;
public:
bank()
{
info();
}
void info()
{
cout<<"Enter Depositer Name : ";
cin.getline(name_of_depositor,20);
cout<<"Enter your Account Numnber : ";
cin>>account_number;
cin.ignore(1,'/r');
cout<<"Enter Type of your Account Type : ";
cin.getline(type_of_acount,20);
cout<<"Enter Total Balnce in Your Account : ";
cin>>balance_in_account;
}
friend class account_handle;
};//Bank Class END
// Class account_handle
class account_handle
{
private:
double depositing_amount;
double withdrawl_amount;
double bal_in_acc;
int option;
public:
account_handle()
{
depositing_amount=0;
withdrawl_amount=0;
cout<<"What You Want : "<<endl;
cout<<"1) Deposite Amount"<<endl;
cout<<"2) Withdraw Amount"<<endl;
cin>>option;
if(option==1)
{
deposite();
}
else if(option==2)
{
withdraw();
}
else
{
cout<<"Invalid Entery...!"<<endl;
exit(0);
}
}
void deposite()
{
cout<<"Enter Deposited Amount : ";
cin>>depositing_amount;
}
void withdraw()
{
cout<<"Enter Withdrawl Amount : ";
cin>>withdrawl_amount;
}
void showbank(bank b)
{
cout<<"Depositer Name : "<<b.name_of_depositor<<endl;
cout<<"Account Numnber : "<<b.account_number<<endl;
cout<<"Account Type : "<<b.type_of_acount<<endl;
cout<<"Total Balnce : "<<b.balance_in_account<<endl;
cout<<"After Deposited , Total Amount : "<<(b.balance_in_account)+(depositing_amount)<<endl;
cout<<"After Withdrawl , Total Amount : "<<(b.balance_in_account)-(withdrawl_amount)<<endl;
}
// How to display on of the function Depoiste/Withdraw.
void result_sheet()
{
//-----?
}
};//account_handle Class END
void main()
{
bank ba;
account_handle ac;
ac.showbank(ba);
getch();
}