Program to illustrate Bank Account info using Class in c++

#include<iostream.h>
class Account
{
    int acc_no;
    float amount;
    char acc_type;
    public:
    Account(){}
    Account(int no,float bal,char type='S')
    {
    acc_no=no;
    amount=bal;
    acc_type=type;
    }
    void display()
    {
    cout<<"\nAccount No. : "<<acc_no;
    cout<<"\nBalance : "<<amount;
    cout<<"\nAccount Type : "<<acc_type;
    }
};
void main()
{
Account a1,a2;
int no;
float bal;
char type;
cout<<"\nEnter Account Number, Balance and Account type";
cin>>no>>bal>>type;
a1=Account(no,bal,type);
cout<<"\nEnter Account Number, Balance";
cin>>no>>bal;
a2=Account(no,bal);
a1.display();
a2.display();
}

1 comments:

Anonymous said...

Wow, this paragraph is pleasant, my sister is analyzing
such things, so I am going to inform her.

Also visit my web site ... laser cellulite treatment

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|