Question: Please use java OBJECTIVES Doing this lab, students have the chance to: -Implement the Linear Quotient (LQHashed) data structure: understand Insert, Fetch, Delete and update

Please use java

OBJECTIVES Doing this lab, students have the chance to: -Implement the Linear Quotient (LQHashed) data structure: understand Insert, Fetch, Delete and update algorithm of the LQhashed structure -Know how to display all the nodes in the LQHashed data structure on the screen -Review the concept of Hashtable data structures -Know how to implement the Java Hashtable class: use functions, put, get, remove, etc. -Know how to read the information of the object from an input file, place to the Hashtable object and write the information of all the nodes in the structure to the file before terminating the program -Know how to display all the nodes in the Hashtable on the screen

REQUIREMENT First: The company A stores the information of all employees in the text file named as dataEmployee.txt. The information of each employee is written on one line in the following format, for example: of 2 lines in file:

Bill - White 0012345 Marketing department 45000

Nancy Nguyen 1234567 Sale department 40000

- Manager Provide an application that allow users can select the type of Hashed data structure to work with. After finishing one type of Hashed data structure, the application should loop back to allow users to select other type until they want to exit

1. LQHashed Data structure

2. Java Hashtable data structure

For each type of Hashed data structure, do the following: First, open and read the file dataEmployee.txt line by line to the end: -For each line, split information for Employee node or Employee with title node -Insert each node to the selected data structure Next, allow users to select one of the following tasks. When finishing one task, loop back to allow users to continue to select other task until they want to exit 1. Insert 2. Fetch 3. Uncapsulation 4. Update 5. Delete 6. Show all

INSERT data -read input information of employees or title employees from the keyboard then create the object and add to the data structure

FETCH data -Display the message to ask for an employee id then Fetch the node from the data structure and display on the screen. If the employee cannot be found, display the message: ID = 1234567 cannot be found where 1234567 is the target key to look for the employee

ENCAPSULATION -Display the message to ask for the id and Fetch that node, ensure that the node is existing in the data structure -change its address COSC2436 Lab6 2 -Fetch again the node with the same key. If the address of this node is not changed; display the message The LQHashed data structure is encapsulated OR The Java Hashtable data structure is encapsulated -If the address is changed, display message: The LQHashed data structure is unencapsulated OR The Java Hashtable data structure is unencapsulated

UPDATE data - Display the message to ask for the id and Fetch that node, ensure that the node is existing in the data structure - Change its salary to become a new node - Update the new node to the data structure - Fetch it again to verify the change

DELETE data -Display the message to ask for a key -If delete successfully, display message Delete success otherwise display message: Delete gets failed

SHOWALL -Display all the nodes currently stored in the data structure Exit program When users choose to exit the program, open the file dataEmployee.txt to write and write all the information of employee nodes or employee with title nodes stored in the data structure to the file dataEmployee.txt Close file

How to do the lab

ANALYZING AND DESIGNING -Draw the UML of class Employee_yourLastName and class TitleEmployee_yourLastName -Write the pseudo-code of the main()

WHAT YOU NEED TO KNOW TO DO THE LAB -Review how to use the do.. while loop to handle the menu to re-display -switch statement to handle each task of menu -How to open the file to read, how to open the file to write, how to read/write from/to the file; how to close the file -How to declare a data structure of type Hashtable; put, get, remove, etc. the nodes

HOW TO START THE LAB -You can create the project named FA2017LAB6_yourLastName then add the data type class FA2017LAB6_Employee_yourLastName, FA2017LAB6_TitleEmployee_yourLastName and a driver class FA2017LAB6_HashedDataStructureDemo_yourLastName

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!