![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 13.05.2021 23:50 aiyannaj
Create a program which reads in CSV data of Creatures and loads them into aHash Map. The key of this hash map will be the name of each creature. For your hash function, you can simply use the sum of all ASCII values. You can also come up with your own hash function. Your program should present a menu to the user allowing them to look up a creature by name. Additionally, create a function that allows the user to insert a new creature. This creature should be added to the existing hash map. If the name entered by the user already exists, DO NOT ADD IT TO THE HASH MAP. Simply report that the creature already exists. If the creature is unique and successfully added, report the calculated index value. Your hash array should start as size4. You will need to implement a rehashing function to maintain a load factor of 0.75. Collision resolution should be handled via separate chaining with linked lists.
Other Requirements
Read in a CSV file from the command line when running the program.
Convert the raw CSV data into the creature struct and add it to a HashMap
Make sure you properly release all of your allocated memory.
Format your code consistently.
Function declarations, structs, and preprocess directives should be placed in a corresponding header file.
Save your code for this problem ascreature_hash.(c|h).
Creature struct
typedef struct {
char *name;
char *type;
int hp;
int ac;
int speed;
} Creature;
Example Run
1. Search
2. Add Creature
3. Exit
> 1
Enter name: Terrasque
Unable to find "Terrasque"
1. Search
2. Add Creature
3. Exit
> 2
Enter name: Storm Giant
Enter type: Huge giant
Enter HP: 230
Enter AC: 16
Enter speed: 50
Storm Giant added at index 3.
CSV file: Name, hp, ac, speed, type
Rakshasa,110,16,40,Fiend
Priest,27,13,25,Humanoid
Berserker,67,13,30,Humanoid
Fire Elemental,102,13,50,Elemental
Kraken,472,18,20,Monstrosity
Centaur,45,12,50,Monstrosity
Mage,40,12,30,Humanoid
Hell Hound,45,15,50,Fiend
Basilisk,52,15,20,Elemental
Androsphinx,199,17,40,Monstrosity
Efreeti,200,17,40,Elemental
Balor,262,19,40,Fiend
Chain Devil,142,19,40,Fiend
Adult Black Dragon,195,19,80,Dragon
Adult Blue Dragon,225,19,80,Dragon
Adult Red Dragon,256,19,80,Dragon
![ansver](/tpl/images/cats/User.png)
Answers: 1
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 02:30
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 02:30
Which option completes the explanation for conflict of interest in an organization
Answers: 1
You know the right answer?
Create a program which reads in CSV data of Creatures and loads them into aHash Map. The key of this...
Questions
![question](/tpl/images/cats/biologiya.png)
Biology, 11.01.2020 01:31
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 11.01.2020 01:31
![question](/tpl/images/cats/mat.png)
Mathematics, 11.01.2020 01:31
![question](/tpl/images/cats/en.png)
English, 11.01.2020 01:31
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/istoriya.png)
History, 11.01.2020 01:31
![question](/tpl/images/cats/mat.png)
Mathematics, 11.01.2020 01:31
![question](/tpl/images/cats/en.png)
English, 11.01.2020 01:31
![question](/tpl/images/cats/mat.png)
Mathematics, 11.01.2020 01:31
![question](/tpl/images/cats/mat.png)
Mathematics, 11.01.2020 01:31
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 11.01.2020 01:31
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/istoriya.png)
History, 11.01.2020 01:31
![question](/tpl/images/cats/mat.png)
Mathematics, 11.01.2020 01:31