Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java - - - have the same eid. name ( as a String ) - The name of the employee. department ( as a String
Java have the same eid.
name as a String The name of the employee.
department as a String The department the employee belongs to
yearJoined as an int The year the employee joined the company.
salary as a double The salary of the employee.
The Employee class should have constructors and methods getters setters, and toString to manage the above information as well as the link to the next and previous employees in the list.
EmployeeList Class: Write the EmployeeList class to hold objects of the class Employee. This class should define the following:
Two instance variables first and last to keep the reference of the first and last employees in the list.
An instance variable count that stores the size of the list. It should be updated whenever a new employee is added to the list or an existing employee is removed.
These are the only variables of this class. Do not add any other variable to the class.
EmployeeList should implement the following interface:TestEmployeeList Class: Write a TestEmployeeList class to test the EmployeeList class. This class should have a main method in which you perform the following actions:
Create an EmployeeList object.
Insert Employees at the end of the created list.
Insert Employees at the front of the list.
Insert Employees at the following positions in the list respectively:
Print the content of your list.
Find out in the list the employees in the same department as the first employee on the list. Print them out.
Remove the first element of the list.
Remove the item at index
Print the content of your list again.
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