Sunday, March 7, 2010

********* C++ - PROGRAM FOR BANKING *********

class bnkacct
{
 private:
  char name[50];
  long ac_no;
  char ac_type[50];
  long amt,t_amt;
  long bal;
 public:
  void getin()
  {
   cout<<"\n ENTER THE NAME : ";
   cin>>name;
   cout<<"\n ENTER THE ACCOUNT NUMBER : ";
   cin>>ac_no;
   cout<<"\n ENTER THE TYPE OF THE ACCOUNT : ";
   cin>>ac_type;
  }
  void deposit()
  {
   cout<<"\n ENTER THE AMOUNT THAT YOU ARE GOING TO DEPOSIT : ";
   cin>>t_amt;
   bal = t_amt;
  }
  void withdraw()
  {
   cout<<"\n ENTER THE AMOUNT TO BE WITHDRAWN : ";
   cin>>amt;
   if(amt<=t_amt)
   {
    t_amt = t_amt-amt;
    cout<<"\n AMOUNT  : "<<<"Rs";
    cout<<"\n BALANCE : "<<<"Rs";
   }
   else
   {
    cout<<"\n UNAVIALABLE BALANCE";
   }
  }
  void display()
  {
   cout<<"\n\n\n NAME     : "<
   cout<<"\n ACC_TYPE : "<
   cout<<"\n BALANCE  : "<
  }
 };
main()
{
 clrscr();
 bnkacct s;
 cout<<"\n\t\t ********* C-PROGRAM FOR BANKING ********* ";
 s.getin();
 s.deposit();
 s.withdraw();
 s.display();
 getch();
 return 0;
}

No comments:

Post a Comment