Answered step by step
Verified Expert Solution
Link Copied!

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 3 Employees at the end of the created list.
Insert 3 Employees at the front of the list.
Insert 3 Employees at the following positions in the list respectively: 0,1,5.
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 2.
Print the content of your list again.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

How are members held accountable for serving in the assigned roles?

Answered: 1 week ago

Question

Have roles been defined and assigned?

Answered: 1 week ago