Source Code : Program For ACC

//…………..Program For  ACC.CPP……………//

#include

#include

#include

#include

class account

{

  private:

  int accountno;

  char name[31];

  float balance;

  char acc_type[10];

  public:

  void initialise()

  {

  balance=500;

  }

  void input();

  void deposit(float);

  void withdraw(float);

  void show();

};

  void account::input()

  {

  cout<<"\n Enter the account number:";

  cin>>accountno;

  cout<<"\n Enter the name:";

  gets(name);

  cout<<"\n Enter the account type:";

  cin>>acc_type;

  }//end input

  void account::deposit(float ammount)

  {

  balance=balance+ammount;

  cout<<"\n Deposited Rs:"<

  }//end deposit

  void account::withdraw(float ammount)

  {

  if(balance-ammount<500)

  {

    cout<<"\nInsufficient balance";

  }

  else

  {

  balance=balance-ammount;

  cout<<"\n Withdrawed Rs:"<

  }///end if else

  }//end withdraw

  void account::show()

  {

  cout<<"\n ACCOUNT  NUMBER:"<

  cout<<"\n NAME:"<

  cout<<"\n BALANCE:"<

  }//end show

//};//end class account

void main()

{

  clrscr();

  account p;

  p.initialise();

  p.input();

  float mammount;

  int ch;

  do

  {

  cout<<"\n 1.Deposit \n2.Withdraw \n3.check balance \n0.exit" ;

  cout<<"\n Enter your choice:";

  cin>>ch;

  switch(ch)

  {

  case 1:

  do

  {

  cout<<"\n Enter the value 2 be deposit:";

  cin>>mammount;

  }while(mammount==0);

  p.deposit(mammount);

  break;

  case 2:

  do

  {

  cout<<"\n Enter ammount for withdraw:";

  cin>>mammount;

  }while(mammount<=0);

  p.withdraw(mammount);

  break;

  case 3:

  p.show();

  break;

  case 4:

    //  return(0);

  break;

  }//end switch

  }while(ch!=0);

  getch();

}//end main