Question
Question 4 Map Collections Consider the following class fragment for an Employee class: class Employee { private String employeeID; private boolean isManager; public String getEmployeeID()
Question 4 Map Collections
Consider the following class fragment for an Employee class:
class Employee {
private String employeeID;
private boolean isManager;
public String getEmployeeID() { return employeeID; }
public boolean getIsManager() { return isManager; }
// ...
}
You are writing code for a Human Resources Management System for your
company. The company has performed very badly over the past year, and
as a result, every employee's salary is being docked by 10%, unless they are
a manager - in which case their salary is increased by 10%. Write the
method adjustSalaries, for which a skeleton is given below. If you need
to make any assumptions, you should state them in a comment in your
code.
/** Adjusts employee salaries down by 10%, unless the employee
* is a manager, in which the salary is increased by 10%.
*
* @param employeeSalaries A map from an Employee object, to an
* Integer representing their salary (in dollars).
*/
public void adjustSalaries(HashMap
// ...
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started