Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ code! please show output Write a program that implements a one-to-one relationship hash function using an ADT List. Implement using an array, personArray. Write

C++ code! please show output image text in transcribed
image text in transcribed
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, Sueanna' DOB: 1/5/2001, 2/6/2002, 317/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 inName, 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 in Name ) ... calls hash function, gets index and uses it to cout the data for that record in the array. Write a function: PrintAll()... 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 person

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

Step: 3

blur-text-image

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

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions