Question: 31%3) Sat 5:32 PM a Class Methods Homework Now, suppose a new company policy says that instead of the moethly salary we will now store
31%3) Sat 5:32 PM a Class Methods Homework Now, suppose a new company policy says that instead of the moethly salary we will now store the yearly salary. We will need to make this change inside Employee and support the new usage withowt breaking existing code (such as the old main) that relies on the old version. Remove the monthly salary instance variable from Employee and add an instance variable for yearly salary (with accessor and mutator). results it did when you ran it for part A, but inside Employee we are using the new instance variable. We should also be able to write new code using Employee that works with yearly salaries Think this through. If someone tries to set YearlySalary(50000) what would they expect to happen? Ir someone tries to setMonthlySalary(1000) what would they expect to happen? Does your code do this? Part C and bonus Whenever the bonus for the position is changed, update the salary for the worker by the same amount (if there is a the salary, since they already got the 100 when they became the worker). You can assume bonuses only increase. (You doa't have to another worker) worry abour the worker losing the bonus whee replaced by Test the class Position later in the same main as for part B B. 31%3) Sat 5:32 PM a Class Methods Homework Now, suppose a new company policy says that instead of the moethly salary we will now store the yearly salary. We will need to make this change inside Employee and support the new usage withowt breaking existing code (such as the old main) that relies on the old version. Remove the monthly salary instance variable from Employee and add an instance variable for yearly salary (with accessor and mutator). results it did when you ran it for part A, but inside Employee we are using the new instance variable. We should also be able to write new code using Employee that works with yearly salaries Think this through. If someone tries to set YearlySalary(50000) what would they expect to happen? Ir someone tries to setMonthlySalary(1000) what would they expect to happen? Does your code do this? Part C and bonus Whenever the bonus for the position is changed, update the salary for the worker by the same amount (if there is a the salary, since they already got the 100 when they became the worker). You can assume bonuses only increase. (You doa't have to another worker) worry abour the worker losing the bonus whee replaced by Test the class Position later in the same main as for part B B
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
