Java class Hashtable


You can use the code from the book page 293

Create a project SP15LAB6_PART1_LastName and add a class name


Declare a Hashtable data structure object named as myHashtable that stores nodes of the Employee where the employee id defined as a String is the key of myHashtable.

Read input from a file named as employeeList.txt that you manually create with several lines. Information of each line in the file employeeList.txt includes: last name, first name, employee Id, department, salary as following format. Also, ensure that the employeeList.txt has one employee having the employee id is 0097765 Bill - White 0012345 Marketing department 45000

Open file employeeList.txt, read each line:

  • create the object of Employee
  • then insert it to the data structure myHashtable created above.

After reading all file employeeList.txt, display the all the nodes from myHashtable to ensure all the information of employees are stored in the myHashtable

//Insert data to the Hashtable

  • Allow users to enter the information of new employee from the keyboard, create an object of Employee then insert it to the myHashtable until they want to stop
  • After users stop entering new employees, display the myHashtable again

//Fetch data

Read the information of one employee who has the employee id is 0012345 from the myHashtable then display the information to the screen

//Update data

Display the message to ask the employee id of Employee that is expected to change the department. Display the message to ask for the new department. Update the node in myHashtable with employee id as the id provided from the keyboard with the new department; then display the myHashtable to see the change

//Delete data

Remove the node of a Employee with employee id is 0097765 from the myHashtable, then display to see the rest of myHashtable to ensure the node is removed

//Exit program

When users choose to exit the program, open the file employeeList.txt to write and write all the information of employee stored in the myHashtable to the file.

Close file Write the comments for each operation

Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.