Question: Lets say I have a employee class, which has a member function void updateSalary(double x); private variable salary; and I want to update the salary.

Lets say I have a employee class, which has a member function void updateSalary(double x); private variable salary; and I want to update the salary.

void employee::update (double x){

salary = x;

x++;

}

Now, my question is, is that a valid or invalid way to do it?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!