Menu

[Solved]7 Objectives Assignment Enhance Knowledge Skill Java Gain Understanding Experience Binary Q37204381

7. The objectives of this assignment are to:

  1. Further enhance your knowledge and skill in Java.
  2. Gain an understanding and experience with binary searchtrees.
  3. Gain further experience using generics.
  4. Gain further experience in using Javadoc documentation.
  5. Continue to practice good programming techniques.

Create a binary search tree class named BST that stores genericswith the methods shown below. Write a test program that thoroughlytests your binary search tree implementation.

boolean add( E item )

adds item to the tree

returns true if add was successful

E find( E target )

finds target in the tree

returns the item found or null, if not found

String toString()

displays the contents as a formatted binary tree

Once the BST class is working, create a class EmployeeMenu thatstores Employee objects in the BST class, and provides a menu toaccess the tree and add new employees. The class will require thefollowing functions to be implemented:

EmployeeMenu ()

constructor that reads employee information from a file, createsemployee objects, and adds then to the binary search tree

void run()

displays a menu as discussed below and handles the optionselected

Write a client program named Prog7 that uses the EmployeeMenuconstructor to populate a binary search tree with Employee objectsread from a file:

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

Remember to provide a toString() method for Employee so that itwill display in a reasonable format when displaying the formattedbinary tree.

The program will use the run() method of EmployeeMenu to providea menu with the following options:

1. Display tree

Display the binary search tree structure (with indentations forlevels) using the toString method as discussed in class.

2. Add employee

Request the employee information and add the employee object tothe tree. Alert user if the employee is not added.

3. Find employee

Request the employee id and then return and display the fullinformation for that employee.

0. Exit

At minimum, this option should perform flawlessly!

Requirements

  • Your source code should use proper object-oriented style. Thatis, the main program should only instantiate a class which displaysand processes the menu.
  • Your source code should be documented using Javadoc styleaccording to the course standards.
  • Follow good programming practices.
  • Use the default package in your project; do not specify apackage in your code.

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 7. 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 *