Question: Consider a class Employee with data members: agelan integer), id (an integer) and salary (a float), and their corresponding member functions as follows class Employee


Consider a class Employee with data members: agelan integer), id (an integer) and salary (a float), and their corresponding member functions as follows class Employee private int age; nt 1 float salary; public Employee(); // default constructor: 0. d-0, salary-0.0 Employee(int x, int y, float z); // parameterized constructor: age-x, id-y, osalaryz -Employee(); // destructor: age-0. d-0, salary = 0.0 Employee.const Employee &); // copy constructor Employee & operator =(const Employee &); // = operator overloading void setAge(int x); void setld(int x); void setSalarv(floatx) int getAgel) fotetSal) You need to provide the definition of all the above member functions. Write a main routine in which you create an array of Employee with 3 elements. Set the first element with the content (age-30, id = 30042554, salary=50000.00), the second element with the content (age-45, id-40041002, salary-60000.00), and the third element with the content (age-50, id-40041004, salary-70000.00). by using the setXXX member functions. Then, pass the array to a function PrintEmployee(argl, arg2), in which argl should be the array of Employee and arg2 is the length of the array (3 in this case). In PrinteEmployee(arg1, arg2), write a for loop to print out the information of each employee by using the fourth through sixth member functions and cout (in this case, we have three employees in total)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
