Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Class employee { Public: employee(); employee(string, int, double); employee(int

ID: 3569546 • Letter: C

Question

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); intgetNumOfServiceYears() 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 instance variable. 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 program to test the class employee

Explanation / Answer

a) void employee::setData(string name, int numOfServiceYears, double pay);

b) void employee::print() const;

c) void employee::updatePay(double pay);

d) int employee::getNumOfServiceYears(int numOfServiceYears) const;

e) double employee::getPay(double pay) const;