I am required to create a program that will allow user to enter employee name,age and update salary later on. After which able to generate out the details.
I am trying to declare a class object in the form of an array so that i can input data and then manipulate the data - add and view by id
class Employee
{
private:
static int id;
char name[20];
char age[20];
double salary;
public:
Employee();
void Add(char n[], char a[], int size);
double getSalary();
void print();
};
int Employee::id = 0;
int Employee::getID()
{
return id;
}
void Employee::Add(char n[], char a[], int size)
{
name[i] = n[i];
age[i] = a[i];
}
int main()
{
char name[20];
char age[20];
Employee employee_list[100];
do{
cout << "Enter name: ";
cin >> name[count];
return 0;
}
cout << "Enter age: ";
cin >> age[count];
employee_list[ ?? ].setInfo( name[count],age[count], count) // nt sure??
cout++;
)while(count < 20);
}
it will display like
Employee List 1
name1 22
name2 33
so on
From here how do i carry on?