Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Definitions help.

$
0
0
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.
Also, I don't mean that you do the work for me, but to help guide me in the correct direction to answer this problem.


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.

I'm not entirely sure, but correct me if I'm wrong. I think b.) is:

void employee::print() const
{
cout << employee
}

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>