#include<iostream>
#include<string>
using namespace std;
class Employee
{
public:
string name;
double salary;
int age;
void getData()
{
cout<<"\nEnter the name of the employee:";
cin>>name;
cout<<"\nEnter Salary of the employee:";
cin>>salary;
cout<<"\nEnter age of the employee:";
cin>>age;
}
void Displaydata()
const{
cout<<"\nEmployee Name:"<<name;
cout<<"\nEmpolyee Salary:"<<salary;
cout<<"\nEmployee age:"<<age;
}
};
int main()
{
int i;
Employee employees[5];
for(i=0;i<5;++i)
{
cout<<"\nEnter details for Employee";
employees[i].getData();
}
cout<<"\nEmployee Details:";
for(i=0;i<5;i++)
{
cout<<"\nEmployee"<<i+1<<":\n";
employees[i].Displaydata();
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: