Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i want implementation of hash table from scratch by three classes 1- passenger.java class will have instance variable: String passenger_name, String ticket_ID, double ticket_price. also
i want implementation of hash table from scratch by three classes
Key = (sum + p) % size Variable Key Description The index used to store ticket_ID in the hashtable Sum P Size Sum of all characters in the passenger_Name A constant prime value of 19 Size of the hash table 1- passenger.java class
will have instance variable: String passenger_name, String ticket_ID, double ticket_price. also create constructor and getter and setter for the variables also toString method that will print the passenger name, ticket id and tickit price
2- booking system.java class
you will store the passenger name and ticket id and price. the passenger will be the key , ticket id and price will be stored value. for collision use the following hash function
3- test class you will be provide a file contain passenger name ticket id and price seperated by comma.
create an object of class bokking system with size 13 use the file to fill the hash table.
there will be a menu where can do the following:
1- add new passenger
by adding a new name, ticket id, price.
you will need to check of ticket validation it must be 6 number_two letter. ex. 123456_US
2- find ticket if passenger name exist it will print the ticket id otherwise not found.
3- update ticket id. where you enter passenger name to change his ticket id
4- print . where you will print the whole table
5- find highest price. where it will print the name of passenger who has the highest price ticket and the ticket id and ticket price
using java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started