Ask Computer Engineering Expert

OBJECTIVES Doing this lab, students have the chance to:

-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

Part1: Java class Hashtable REQUIREMENT The company A stores the information of all employees in the text file named as employeeInfo.txt. The information of each employee is written on one line in the following format, for example:

For the employee:

Bill - White - 0012345 - Marketing department - 45000

Or for the employee with the tittle:

Nancy - Nguyen - 1234567 - Sale department - 40000 - Manager

The application will use Hashtable object as data structure then open and read the file employeeInfo.txt The information of each line of the file employeeInfo.txt as a node to be inserted to the data structure. After reading the file, ensure all the information of employees or title employees are stored in the data structure by showing all nodes.

Provide the menu to allow users to select the following tasks. After finishing each task, re-display the menu to allow user to continue using the application:

1. Insert employee or employee with title

2. Fetch

3. Encapsulation

4. Update

5. Delete

6. Show all

7. Exit

//INSERT data to the Hashtable

-Allow users to enter the information of an employee or an employee with the title from the keyboard

-Create the object then insert to the data structure -Users can continue inputing until users want to stop

//FETCH data -Allow users to type an employee id then read the information from the data structure to print out the information on the screen

//ENCAPSULATION -Allow users to type an employee id from the keyboard. Using the entered employee id to read the information of the node from data structure then assign the information to the node named "temp". Change the salary of the node temp

-Fetch the node with the entered employee id again then compare its salary with the salary of the node temp. . If the salary are different then display the message box: "The Java Hashtable structure has the encapsulation"; otherwise display the message box: "The Java Hashtable structure does not have the encapsulation"

//UPDATE data Display the message to ask users to enter the employee id. Using the employee id to read the node out the data structure. Asking for the new department from the keyboard. Change the department with the new department. Display the node from the data structure to check new updated information

//DELETE data Display the message to ask users to enter the employee id. Remove the node with the entered employee id

//SHOW ALL Display all the nodes are currently stored in the data structure
//Exit program When users choose to exit the program, open the file employeeInfo.txt to write and write all the information of employee nodes stored in the data structure to the file employeeInfo.txt Close file

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

PART2: Linear Quotient (LQHashed) Data Structure 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

REQUIREMENT Provide the application that creates a data structure of type LQHashed then provides the menu that includes the following tasks and allow users to work on each task until users want to exit

1. Insert

2. Fetch

3. Encapsulation

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 until users want to stop.

FETCH data -Display the message to ask for an employee id then Fetch the node from the LQHashed data structure to node named temp and display the information of node

ENCAPSULATION -Use the above node fetched from the LQHahsed data structure, change the salary of temp -Fetch employee with the same employee id again to see if they have the same salary then display display the message box: "The LQHashed structure has the encapsulation"; otherwise display the message box: "The LQHashed structure does not have the encapsulation"

UPDATE data

-Display the message and read the employee id then fetch the node to node temp

-Read the new department from the keyboard, update the new department to temp

-Update the new node to the data structure

DELETE data -Display the message and read the employee id then using the employee id to delete the node

SHOWALL -Display all the nodes currently stored in the data structure

ANALYZING AND DESIGNING -Write the pseudo-code of the main()

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93065173

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As