Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please follow all the instructions, in C + + make sure to read all the prompt and do what it says for the . h
Please follow all the instructions, in C make sure to read all the prompt and do what it says for the h files and the cpp files and follow them because its really important
The goal of the third program is to create a hash table using chaining. Hash tables are very useful in situations where an individual wants to quickly find their data by the value or search key The client program uses a key instead of an index to get to the data. The key is then mapped through a hash function which supplies an index!
Specifics
Have you ever wanted to find information on the web just to have to go through so many websites and posts that were irrelevant. Once you find a great website with valuable and correct information, making it a favorite is nice but at some point how many favorites do you have and it becomes difficult to filter through. In program# you are going to have the client program search by topic egHash Functions or Finance and retrieve all of the website information that you have collected about that topic.
Part I: The Table ADT
The Table ADT is implemented using a hash table with chaining array of linked lists
For each website, keep track of the following information
Topic name egData Structures
Website address
Summary of what you can find at this address egThe classic, bestselling Data Abstraction and Problem Solving with C: Walls and Mirrors book provides a firm foundation in data structures
Review eg your thoughts about how helpful this site is
Rating stars being not very useful, being very useful
The required functions for your Table ADT are:
Constructor
Destructor deallocate the hash table
Insert a new website by topic add websites information into the hash table
Retrieve retrieve all websites based on the topic keyword supplied
Retrieve will need an array of websites and the number of matchings as arguments for the ADT to fill. It returns a successfail flag for whether or not it found a match. Retrieves arguments might be something like:
bool retrievechar topickeyword, website allmatches int & numfound;
Retrieve should not correspond with the user ie it should not prompt, echo, input, or output data
Edit modify the review and rating for a particular topic and website match
Remove remove all websites with a star rating
Display only displaying matches, based on the topic keyword
Display all
Monitor the performance of hashing function by displaying each chain length
Part II: The Driver or the Test Program
The test program needs to first load the test data set from external file at the beginning of the program. The test program needs to allow user to add a new website, retrieve all websites for a given topic, edit a website to modify the review and rating, remove all websites with a star rating, and display all matches for a given topic, and then a display all not in order! It should also allow user to monitor the performance of the hash table the monitor function in the ADT
The menubased user interface should allow user to usetest ALL the functionalities of the program. Try to make the user interface easier to use.
Always prompt user when you need input data.
The prompt needs to be meaningful. Example works great. EgEnter the rating eg :
When asking user to choose some existing data, index works great. You can display the data with index preceding each one first.
Things you should know...as part of your program
Do not use statically allocated arrays in your classes or structures. All memory must be dynamically allocated and kept to a minimum!
All data members in a class must be private
Never perform input operations from your class in CS
Global variables are not allowed in CS
Do not use the String class! use arrays of characters instead and the cstring library!
Use modular design, separating the h files from the cpp files. Remember, h files should contain the class header and any necessary prototypes. The cpp files should contain function definitions. You must have at least h file and cpp files. Never #include" cpp files!
Use the iostream library for all IO; do not use stdio.h
Make sure to define a constructor and destructor for your class. Your destructor must deallocate all dynamically allocated memory.
NEVER use global variables in these programs!
Avoid the use of exit, continue, or break to alter the flow of control of loops
Avoid using while type of loop control
NEVER use the string class in CS instead use arrays of characters
Abstract Data Types should NEVER prompt the user or read information in All information should be passed from the client program or application
Abstract Data Types should NEVER display error messages but instead supply successfail information back to the calling routine.
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