Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

data structures image text in transcribed
image text in transcribed
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

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 Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

13. Verify the statement made in the remark following Example 10.2.

Answered: 1 week ago