#include
using namespace std;
int choice;
double balance = 10000;
class account
{
char name[30];
int acc_no;
int acc_type;
public:
double bal;
void customer()
{
cout<<"\n\n\tEnter Your Name: ";
cin>>name;
cout<<"\n\n\tEnter Your Account Number: ";
cin>>acc_no;
}
};
class curr_acct:public account
{
public:
void current()
{
int choice,add;
cout<<"\n\n\tYour account is Current.";
while(1)
{
cout<<"\n\n\t1.Deposit Balance \n\n\t2.Withdraw Balance. \n\n\t3.Exit. \n\n\tEnter Your Choice: ";
cin>>choice;
switch(choice)
{
case 1:
cout<<"Enter The Amount Do You Want To Deposit: ";
cin>>add;
balance = balance + add;
cout<<"Now
Your Balance is = \t"<
break;
case 2:
cout<<"You Can Withdraw Your Amount Using Cheque Book.\n\n\t Enter the Amount = ";
cin>>bal;
if(bal<=balance)
{
balance=balance-bal;
if(balance<=1000)
{
cout<<"\n\n\tYour Balance Is Less Than 1000 Rs.,So Have Service Charged 100 Rs.\n";
balance=balance-100;//service charge.
}
cout<<"\n\n\tCurrent
Balance= "<
}
else
cout<<"\n\n\tInsufficient Balance.\n";
break;
case 3:
exit (0);
default:
cout<<"You Have Entered Wrong Choice.";
}
}
}
};
class sav_acct:public account
{
public:
void saving()
{
cout<<"\n\n\tEnter The Amount You Want To Withdraw = ";
cin>>bal;
if(bal<=balance)
{
balance=balance*1.1;//interest
balance=balance-bal;
cout<<"\n\n\tCurrnt
Balance="<
}
else
cout<<"\n\n\tInsufficient Balance.\n";
}
};
int main()
{
int choice;
system("clear");
cout<<"~~~~~~~~~~~~~~~ BANK PROGRAM ~~~~~~~~~~~~~~~";
account a;
curr_acct c;
sav_acct s;
cout<<"\n\n\tWhich Type Of Account Do You Want To Create\n\n\t1.current 2.saving = \t";
cin>>choice;
a.customer();
cout<<"\n\n\tCurrent
Balance= "<
if(choice==1)
{
c.current();
}
else if(choice==2)
{
s.saving();
}
return 0;
}
Copyright © 2011 - All Rights Reserved - Softron.in
Template by Softron Technology