subject

M. A.S. H. is a text-based game that will predict your future! M. A.S. H. is an abbreviation for the potential future places of residence: Mansion, Apartment, Shack, House. :)This activity provides experience adding items to, selecting items from, and iterating over LinkedLists. It also provides experience with Dynamic Memory allocation, pointers, arrays and structs.1. Carefully study the DataNode header file (DataNode. h)The DataNode struct as well as function declarations for the related functions described below have been provided in DataNode. h. Please do not modify the provided DataNode. h file. Details regarding each function as well as expected return values are included in the comments associated with each function declaration in DataNode. h. The following is a summary of this content:Data memberschar * dataValueint dataSizestruct DataNode* nextNodePtrRelated functionsDataNode* CreateDataNode(const char data[])int InsertDataNodeAfter(DataNode* nodeInList, DataNode* newNode)int SetNextDataNode(DataNode* nodeInList, DataNode* newNode)DataNode* GetNextDataNode(DataNode* nodeInList)void PrintDataNode(DataNode* thisNode)void DestroyDataNode(DataNode* thisNode)DataNode* BuildDataList(char * data[])int GetDataListSize(DataNode* listHead)void PrintDataList(DataNode *listHead)DataNode* GetRandomDataNode(DataNode *listHead)void DestroyDataList(DataNode* listHead)2. Implement each of the related functions listed above (DataNode. c) Test each function as it is written by developing testcases in mytests. c. Be sure to run the tests through valgrind to catch any memory related errors that might not be immediately visible during normal safepath testing. valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./mytestsNOTE: If your testing does note seem to produce random results when calling GetRandomDataNode, this is likely because rand() has a default seed value of 1. To change the seed value to the current time you will need to include and then make the following call to srand() in main() before your first call to rand(). It is important that you only call srand() once and only in main().srand(time(0));3. Implement M. A.S. H. Game Database (main. c)Use an array of DataNode pointers to store the game data, with an ENUM for the indexes as follows:database[HOME_LIST] >>>>> DataNode* listHead for list of homesdatabase[FEMALE_SPOUSE_LIST] >>>>> DataNode* listHead for list of female spousesdatabase[MALE_SPOUSE_LIST] >>>>> DataNode* listHead for list of male spousesdatabase[OCCUPATION_LIST] >>>>> DataNode* listHead for list of occupationsdatabase[TRANSPORTATION_ LIST] >>>>> DataNode* listHead for list of transportion - - methodsdatabase[HOMETOWN_LIST] >>>>> DataNode* listHead for list of hometownsThe data values should be specified in an char array of strings by using an initializer list. This array will be passed to the BuildDataList function as a parameter which will in turn construct the list, allocating memory as required, and return a pointer to the listHead. This pointer should be stored at the cooresponding index in the database.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead w 4 epizodzie
Answers: 1
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
question
Computers and Technology, 24.06.2019 05:50
What all vehicles has tesla inc. created over the years
Answers: 3
question
Computers and Technology, 25.06.2019 01:30
The study of how to design software, solve problems such as computer security threats, or come up with better ways of handling data storage
Answers: 1
You know the right answer?
M. A.S. H. is a text-based game that will predict your future! M. A.S. H. is an abbreviation for the...
Questions
question
Mathematics, 12.06.2020 22:57
question
Mathematics, 12.06.2020 22:57
Questions on the website: 13722360