Menu

[Solved]9 Objectives Assignment Enhance Knowledge Skill Java Gain Understanding Experience Represe Q37204549

9. The objectives of this assignment are to:

  1. Further enhance your knowledge and skill in Java.
  2. Gain an understanding and experience with representing graphsin data structures.
  3. Gain an understanding and experience with hash tables.
  4. Gain further experience in using Javadoc documentation.
  5. Continue to practice good programming techniques.

Create a class named HashTable that stores a generic data in ahash table using linear probing with the methods below:

HashTable(int num)

constructor for hash table with num slots

void add(E item)

adds item to the hash table

void display()

prints the contents of the hash table in the format below

The display() method will print the contents of slots in orderincluding actual slot number, hash code of the contents, calculatedindex (hash code % number of slots), and employee name.

Slot#    Hash Code Index Contents

   0                     empty

    1   172648051      1 Beau Vine

    2   516827802      2 Allie Gator

    3  -546690528      3 Amy Asparagus

    4   282857501      1 Winnie DePoo

    5  1235494305      5 Susan Squash

Write a client program named Prog8 that asks the users for thenumber of slots and instantiates a HashTable object with thatnumber of slots. The program then reads the file employee.txt whichcontains the 4 fields shown below, calculates the hash code for theemployee ID (note that it is a String) and the corresponding index,and adds the Employee object to the hash table. When the entirefile has been read, display the contents of the hash table. Itshould also print the number of names that were relocated due tocollisions.

employee.txt file:   CSV(comma separated value) text file in which each line in the filerepresents an employee. The comma delimited fields are:

Fields

Description

Employee ID

string

First Name

string

Last Name

string

Salary

double

employee.txt

123, Beau, Vine, 142500882, Bjorn, Free, 65000495, Pete, Zah, 102468.2246, Win E., De Poo, 68123222, Moe, Skeeto, 12789.8987, Jed I., Knight, 1000000.01164, Teddy, Baer, 42500248, Allie, Gator, 65000812, Sally, Mander, 53000973, Amy, Asparagus, 83768.95542, Charles, Cucumber, 36900092, Zachary, Zucchini, 120000.52764, Otto, Orange, 32589.5249, Ellen, Endive, 101050896, Fred, Fennel, 56874.05200, Rita, Rutabaga, 9876.2642, Gregory, Grape, 61200384, Paula, Pear, 62100628, Susan, Squash, 58400.32136, Henry, Huckleberry,41234.5824, Tom, Tomato, 83768.95

Expert Answer


Answer to 9. The objectives of this assignment are to: Further enhance your knowledge and skill in Java. Gain an understanding and… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *