Not sure what this is asking for

I have an assignment that is asking for:
2) FullTime has its own private data member called salary
a. Its constructor has two parameters (name and salary) which invokes the constructor for Employee
b. It has a function printFullTime that invokes the printEmployee function and also prints the salary
c. It has a function printWages that calls printFullTime

When it says to have printFullTime invoke printEmployee, does it mean to do this?:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Employee //Given class
{
private:
	char *name;
public:
	Employee() {}
	Employee (char *n)
	{
		name = new char[strlen(n)+1];
		strcpy(name, n);
	}
	void printEmployee()
	{
		cout<< "Employee name: "<< name <<endl;
	}
};

class FullTime : public Employee
{
private:
	int salary;
public:
	FullTime(char &name, int sal):
	Employee(&name),
	salary(sal)
	{
	}
	void printFullTime():
	Employee::printEmployee()
	{
		cout<< "Fulltime annual salary: " << salary <<endl;
	}
};


Also what does it mean when it says the have a function called printWages that calls printFullTime?
Last edited on
1
2
3
4
void func_a()
{
      func_b();
}


func_a "calls" func_b.

This answers both of your questions, which were actually the same question.
Topic archived. No new replies allowed.