Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

CpE 207L-Data Structures Lab Lab Project Due March 4th, 2021 In this project, you will use Hash table to store the shipments information for a

image text in transcribed
image text in transcribed
CpE 207L-Data Structures Lab Lab Project Due March 4th, 2021 In this project, you will use Hash table to store the shipments information for a shipping company. The program allows you to supplement the company with additional new shipments. The shipment information includes the following: String ShippingAddress Il in this form area_block_street_house String CustomerName int customer Number int shipmentNumber where the area is the key of the hash table. You need to write and submit a java program that includes three classes: Shipment.java, ShippingService.java and ShippingTest.java. 1) Class Shipment Instance variables: private String shippingAddress; private String customerName; private int customerno; private int shipmentNo: Methods: A constructor that initializes the instance variables. Set and get methods for each instance variable. .toString method that returns a string containing shippingAddress, customerName, customerNo and shipmentNo. 2) Class Shipping Service Instance variables: private Shipment tablet: Il Hash table private int size; // Hash table size Methods: public Shipping Service(int size) Create an array of shipments and save the size of the hash table. public int hashFun(String address) Split the string address, based on underscore, to get the area. Then, find the summation of characters ASCII values of area and return the hash key. public boolean insert(Shipment s) Insert the shipment s in the proper location and return true. When a collision happens, use linear or quadratic propping. If the hash table is full, return false. public void printTable() Call toString() method and print the contents of the Hash Table as shown in the sample output public int countArea(String area) Count and return the number of shipments in the given area. public void printCustomers(String area) Print all customers' names in the given area. 3) Class Shipping Test In the main method, create an object of class Shipping Service with size = 13. Display a menu of choices, as shown in the sample output. Add your sample output as a comment at the end of the test class. Add comments before each method

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students explore these related Databases questions