Definitions help.

Can someone help me on this problem, because I just don't get what they are trying to tell me without an example (not just words).

NOTE: If you have nothing positive to say, do post here at all! Thank you.
———————————————————————————————————————————————————
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class employee
{
public:
	employee();
	employee(string, int, double);
	employee(int, double);
	employee(string);

	void setData(string, int, double);
	void print() const;
	void updatePay(double x);
	int getNumOfServiceYears() const;
	double getPay() const;

private:
	string name;
	int numOfServiceYears;
	double pay;
};


a.) Write the definition of the function setData so that the instance variables are set according to the parameters.

b.) Write the definition of the function print to output the values of the intance variables.

c.) Write the definition of the function updatePay to update the value of the instance variable pay by adding the value of the parameter.

d.) Write the definition of the function getNumOfServiceYears to return the value of the instance variable numOfServiceYears.

e.) Write the definition of the function getPay to return the value of the instance variable pay.

f.) Write a program to test the class employee.
Last edited on
I'm thinking b.) is:

1
2
3
4
void employee::print() const
{
	cout << employee
}


Please correct me if I'm wrong, but please help out if possible.
Did you try compiling it? You would get errors.

Do you know what a function definition is? Try looking it up in the reference section this site.
Topic archived. No new replies allowed.