Start with the code below. The functions in Employee class are not yet defined, they need to be. This is also true with WorkGroup, but new functions need to be added as well. There needs to be an overloaded "==" operator defined (determine if duplicate workgroups exist). Since the WorkGroup class uses dynamic memory, there needs to be an overloaded assignment operator, a copy constructor and a destructor.
For the Employee class make sure that no person is underage or too old (less than 16 or greater than 80). Do nothing for the set function if the person's age is out of range.
The addEmpl function should add a new employee to the list if there is room in the array. If successfully added, the function returns a true. If not, no change is made to the array and the function returns a false.
In the WorkGroup class, the "workers" value keeps track of how many people are in the group, while "max" is the size of the array.
#include
#include
using namespace std;
class Employee
{
public:
void set(string f, string l, int a, double wp)
{
}
string getFN()
{
}
string getLN()
{
}
int getA()
{
}
double getWP()
{
}
private:
string fname, lname;
int age;
double wklyPay;
};
class WorkGroup
{
public:
WorkGroup()
{
}
WorkGroup(int howMany)
{
}
bool addEmpl(string f, string l, int a, double wp)
{
}
void displayAll()
{
}
private:
Employee *ea;
int workers, max;
};
int main()
{
// there needs to be testing code here
return 0;
}