Question: Magic Potion You will design and implement a system, in C++, to catalogue magic components, their various attributes and potions that can be used. Your
Magic Potion
You will design and implement a system, in C++, to catalogue magic components, their various attributes and potions that can be used. Your system should act as a database and allow the user to load in multiple tables of data, run basic queries on the data, and then store the data off for later us.
Your program must provide the following functionality and adhere to the following constraints:
-Allow the user to choose the file describing the initial setup of the database
-The first set of lines in this file will provide a space delimited pair of a file name and a table name that should be used for the data within that file
-There will be one pair per line
-The next line will be an empty line
-The remaining lines will be basic operations including INSERT, UPDATE, SEARCH, DELETE, DISPLAY and WRITE
-For each table file:
--The first line will list the tables keys
--The second line will list the tables scheme
-- All other lines will be | delimited rows of data to be inserted into the table
--While the data may change for different sets of input files, the schemes will always be identical for each table
--Each table should be implemented as a hash table with the tables keys being the key for the row entry.
--You must implement your own hash table and hash function
--You may choose your collision strategy from the strategies we have covered in class
--You may choose your hashing function from the strategies we have covered in class
--You may not use the map, unordered_map, or any other hash table from any of the C/C++ libraries, STL, or Boost libraries
--You may not use the hash function or any other hashing function from any of the C/C++ libraries, STL, or Boost libraries
-The queries should be implemented in the following way:
--INSERT(string ,string) where the first string is a tuple of values, and second string is the table name
---INSERT should alert the user and not overwrite the data if there is already an entry with that key value
----Otherwise INSERT should add the data to the table and report a successful insertion
-----Be sure to specify the key and the table in the reporting.
--UPDATE(string ,string) where the first string is a tuple of values, and second string is the table name
---UPDATE should alert the user and not insert the data if there is no entry with that key value
----Otherwise UPDATE should alter the data that key points to and report a successful update
-----Be sure to specify the key and the table in the reporting.
--SELECT(string ,string), where the first string is a tuple that can have either a value or * for each component, and second string is the table name
---SELECT should alert the user if no rows match the query
----Otherwise SELECT should output all rows that match the query
--DELETE(string ,string) where the first string is a tuple that can have either a value or * for each component, and second string is the table name
---DELETE should alert the user if no rows match the query
----Otherwise DELETE should remove all rows that match the query and report a successful deletion
-----Be sure to specify the key and the table in the reporting.
--DISPLAY()
---DISPLAY should output the current state of each table to the user in a tabular format
----Be sure to include the attribute names for each table
--WRITE()
---WRITE should write the data in each of the tables to a separate file in the same format they were read in
----The first line will list the tables keys
-----The second line will list the tables scheme
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
