Question: For this assignment, you must write two classes: Employee.java and Company.java. Inspect their UML diagrams beloww Employee Compan -employeeDatabase: HashMap +getEmployeeDatabase(): HashMap populateEmployeeDatabase(Scanner): void +addEmployee(String,

 For this assignment, you must write two classes: Employee.java and Company.java.

Inspect their UML diagrams beloww Employee Compan -employeeDatabase: HashMap +getEmployeeDatabase(): HashMap populateEmployeeDatabase(Scanner):

For this assignment, you must write two classes: Employee.java and Company.java. Inspect their UML diagrams beloww Employee Compan -employeeDatabase: HashMap +getEmployeeDatabase(): HashMap populateEmployeeDatabase(Scanner): void +addEmployee(String, int): void +increaseSalary(int): void -name: String salarv: double id: int emploveeCount: static int +getld(): int +getName): String +getSalary): double +setld(int) +setName(String +setSalary(double) +getEmployeeCount(): static int +print(): void +equals(Emploveel: boolean *Items listed in red are bonus *Note: Constructors are not listed in UML Diagrams For Employee.java 1. 2. Define an Employee's 3 attributes: id, name, salary Define a static int employeeCount inititally set to 0 Increment this variable whenever a new Employee object is created a. i. (Hint: in all of your constructors!) 3. Write accessors for: name, salary, id, and employeeCount 4. 5. a. I should be able to call getEmployeeCount) with the class name (not objects!) Write mutator methods name and salary Write a print method that prints an employee object's information as follows Employee ID: 5 Name: Alice Salary: $50000.0 //Note the $,:, and spacing 6. Define at least two constructors for the Employee class One constructor must be the default constructor (no parameters) In each constructor, initialize salary and name to some default values or the values passed in if you have parameters In each constructor, be sure to increment the employee count and set that Employee object's id number to the current count. Example code to test with a. b. c. d. Employee e1-new Employee(); Employee e2new Employee(); System.out.println(e1.getld(): //prints 0 System.out.println(e2.getld(): //prints 1 System.out.println(Employee.getEmployeeCount()); //prints 2 7. Write an equals method that determines if two Employee objects have the same values for all three attributes. Example code to test with Employee e1 new Employee(810, "Alice", 5); Employee e2 new Employee(810, "Alice", 5); //your constructor may be different System.out.println(e1.equals(e2)); //prints true For this assignment, you must write two classes: Employee.java and Company.java. Inspect their UML diagrams beloww Employee Compan -employeeDatabase: HashMap +getEmployeeDatabase(): HashMap populateEmployeeDatabase(Scanner): void +addEmployee(String, int): void +increaseSalary(int): void -name: String salarv: double id: int emploveeCount: static int +getld(): int +getName): String +getSalary): double +setld(int) +setName(String +setSalary(double) +getEmployeeCount(): static int +print(): void +equals(Emploveel: boolean *Items listed in red are bonus *Note: Constructors are not listed in UML Diagrams For Employee.java 1. 2. Define an Employee's 3 attributes: id, name, salary Define a static int employeeCount inititally set to 0 Increment this variable whenever a new Employee object is created a. i. (Hint: in all of your constructors!) 3. Write accessors for: name, salary, id, and employeeCount 4. 5. a. I should be able to call getEmployeeCount) with the class name (not objects!) Write mutator methods name and salary Write a print method that prints an employee object's information as follows Employee ID: 5 Name: Alice Salary: $50000.0 //Note the $,:, and spacing 6. Define at least two constructors for the Employee class One constructor must be the default constructor (no parameters) In each constructor, initialize salary and name to some default values or the values passed in if you have parameters In each constructor, be sure to increment the employee count and set that Employee object's id number to the current count. Example code to test with a. b. c. d. Employee e1-new Employee(); Employee e2new Employee(); System.out.println(e1.getld(): //prints 0 System.out.println(e2.getld(): //prints 1 System.out.println(Employee.getEmployeeCount()); //prints 2 7. Write an equals method that determines if two Employee objects have the same values for all three attributes. Example code to test with Employee e1 new Employee(810, "Alice", 5); Employee e2 new Employee(810, "Alice", 5); //your constructor may be different System.out.println(e1.equals(e2)); //prints true

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!