subject

Consider the definition of the class employee as given below. answer the following questions: class employee //line 1 { //line 2 public: //line 3 employee(); //line 4 employee(string, int, double); //line 5 employee(int, double); //line 6 employee(string); //line 7 void setdata(string, int, double); //line 8 void print() const; //line 9 void updatesalary(double x); //line 10 int getnumofserviceyears() const; //line 11 double getsalary() const; //line 12 private: //line 13 string name; //line 14 int numofserviceyears; //line 15 double salary; //line 16 }; //line 17

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 variables.
c. write the definition of the function updatesalary to update the value of the instance variable salary by adding the value of the parameter.
d. write the definition of the function getnumofserviceyears to return the value of the instance variable numofserviceyears.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
Ayear in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: the year must be divisible by 4if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year.ex: if the input is 1913, the output is: 1913 is not a leap year.
Answers: 2
question
Computers and Technology, 22.06.2019 18:00
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
question
Computers and Technology, 22.06.2019 21:30
Nathan wants to create multiple worksheet containing common formatting styles for his team members. which file extension him to save these worksheets? nathan to create multiple worksheets with common styles. he needs to save them with the extension.
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
What are the different parts of computer
Answers: 2
You know the right answer?
Consider the definition of the class employee as given below. answer the following questions: class...
Questions
question
Biology, 14.10.2019 07:00
question
Chemistry, 14.10.2019 07:00
Questions on the website: 13722367