Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++ Write a program that implements a one-to-one relationship hash function using an ADT List. Implement using an array, personArray. Write the one-to-one function
In C++
Write a program that implements a one-to-one relationship hash function using an ADT List. Implement using an array, personArray. Write the one-to-one function that hashes the 'name' into an unique array index. (Hint: # chars in a name ?) For each person, using their unique one-to-one hash-determined index, you will store their name, date of birth and their favorite desserts, in the array, Name: ', 'Bo, 'Tuy, 'Alta, Kobet, 'Teddie, Susanna DOB: 1/5/2001, 2/6/2002, 3/7/2003, 4/8/2004, 5/9/2005, 6/10/2006, 7/10/2007 FavDesserts t: Cheese Cake, Vanilla Ice Cream, "Fruit Salad, Chocolate pudding: Orange Jell-o; Apple Pie', 'Tres Leches Cake Write a class: Person, with three private variable: Name, DOB and FavDesserts. Note: DOB is just a string: "MM/DD/YYYY" Write a hash function that determines the proper index, based off the name. Write a function: PutData( string in Name, string favDessert, string DOB) ... call hash function, gets index and use it to assign values to that person in the array. Write a function: PrintData( string inName)... calls hash function, gets index and uses it to cout the data for that record in the array. Write a function: PrintAllo... prints out all data in the array for each person. Input the 7 persons, and print out the data for the 7 persons, print out data for just 1 personStep 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