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, 21.06.2019 13:30
What are the main arguments/points presented in the video about consciousness? present your opinion about the arguments. do you agree with all points? feel free to offer you personal reflections about the video?
Answers: 1
question
Computers and Technology, 22.06.2019 16:30
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 2
question
Computers and Technology, 23.06.2019 15:20
What does a bonus object do? a. subtracts lives b. keeps track of a player's health c. gives a player an advantage d. makes text appear
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Which finger presses the h key on the keyboard? index finger on the left hand pinky finger on the right hand index finger on the right hand thumb on the left hand
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, 10.03.2020 04:44
question
Chemistry, 10.03.2020 04:44
question
Chemistry, 10.03.2020 04:44
Questions on the website: 13722362