You should use better class design in coding by only do the operation of increasing the member salary. Than is the object
updated to the correct value. Than the getter should return the correct value.
public void yearlySalaryIncrease() {
setmonthlySalary( monthlySalary * 1.1 );
}