Thursday, December 9, 2010

//Array of Objects(Headerfiles are iostream.hand conio.h

//Program to demostrate an array of bank account objects
#include
#include
class account
{
private:
int acc_no;
char name[15];
double balance;
public:
void input_data();
void display_data();
}
;
void account::input_data()
{
cout<<"\nEnter Account No,Name,Balance=";
cin>>acc_no>>name>>balance;
}
void account::display_data()
{
cout<<"\nAcc Number="<cout<<"\nAcc Holder Name="<cout<<"\nAcc.balane="<}
int main()
{
clrscr();
account acc[10];
int n;
cout<<"\nEnter no.ofacc holders=";
cin>>n;
for(int i=0;i{
acc[i].input_data();
}
for(i=0;i{
cout<<"\nInformation of Acc="<acc[i].display_data();
}
getch();
return 0;
}

No comments:

Post a Comment

Programming the Whole World!