Write a C++ program to declare a class ‘Account’ with data members as accno, name and bal. Accept data for eight accounts and display details of accounts having balance less than 10,000.
#include<iostream.h>
#include<conio.h>
class Account
{
long int accno, bal;
char name[10];
public:
void getdata()
{
cout<<"\nEnter account number, balance and name ";
cin>>accno>>bal>>name;
}
void putdata()
{
if(bal>10000)
{
cout<<"\nThe Account Number is "<<accno;
cout<<"\nThe Balance is "<<bal;
cout<<"\nThe Name is "<<name;
}
}
};
void main()
{
Account a[8];
int i;
clrscr();
for(i=0;i<8;i++)
{
a[i].getdata();
}
for(i=0;i<8;i++)
{