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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:00, EinsteinBro
Kyle wants to access his school’s home page. how can he do this?
Answers: 1
image
Computers and Technology, 22.06.2019 10:00, IHeartDarkSide03
Which is a false statement considering copyright law? a. when people upload something to the internet they automatically receive a copyright for the work b. the work does not have to contain a copyright notice to be considered having a copyright c. copyright is legal term describing rights given to the creators for literary and artistic works d. personal pictures are always covered by copyrights
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, Knownothing
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
image
Computers and Technology, 23.06.2019 06:30, eddsworldfrantic
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
Answers: 1
You know the right answer?
Consider the definition of the class employee as given below. answer the following questions: class...

Questions in other subjects:

Konu
Mathematics, 26.06.2019 03:00