data structures
CpE 207L52-Data Structures Lab Project In this project, you will use Hash table to store trainees of a Gym. The program will store records of the trainees with the following data: the name of the Trainee, weight, enrolment date and height. The name will be the key of your data structure. A menu of choices should be displayed as follows: The hash function that will be used is: Take the first character of the Trainee name, convert it into uppercase. Take the last character and Convert it into Uppercase, . Convert both of them to ASCII. Cast them into int Add them Together Raise the result into the power of 2 The final result to % table size For Example: Assume the String is 'Afrah' and the table size = 7. Then: A= 65, h to be H = 72, the hash code = (65 + 7222 = 28561 %7 = 1 In case of Collision, Use Chaining with a Double Linked List, Write the code yourself from the scratch without using libraries or collections. Welcome to Gym. Enter: 1. Add a new record 2. Print the table 3. Calculate average weight. 4. Quit You need to write and submit a java program that includes three classes Trainee.java, Gym.java and Test.java. In the Test class, create an object of class Gym with size 7. Add your sample output as a comment at the end of the Test class. CPE 207L: Data Structures Lab Fall 2020 1 Sample output: Welcome to Gym. Enter: 1. Add a new record 2. Print the table 3. Calculate average weight of all trainees. 4. Quit Enter the Trainee name or **"to Stop: Afrah Enter Weight: 80 Enter Height: 175 Enter Enrollment Date (Year - Month-Day ): 2019 22 Enter the Trainee name or to Stop: Shadan Enter Weight: 60 Enter Height: 165 Enter Enrollment Date ( Year - Month-Day): 2018 9 11 Enter the Trainee name or "*" to Stop: Sadan Enter Weight: 70 Enter Height: 160 Enter Enrollment Date ( Year - Month-Day ): 2020 55 Enter the Trainee name or "*" to Stop: Welcome to Gym. Enter: 1. Add a new record 2. Print the table 3. Calculate average weight of all trainees. 4. Quit 2 Trainee Height Weight Enrollment Date Afrah 175 80 2019 2 2 Shadan 165 60 2018 9 11 Sadan 160 70 2020 55 Welcome to Gym. Enter: 1. Add a new record 2. Print the table 3. Calculate average weight of all trainees. 4. Quit 3 Average weight = 70 KG Welcome to Gym. Enter: 1. Add a new record 2. Print the table 3. Calculate average weight of all trainees. 4. Quit 4 See you