Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 22:30, ghari112345
Jamie has to enter the names, employee id’s, and income of a group of employees into a worksheet. which option will jamie use to describe the data
Answers: 3
image
Computers and Technology, 24.06.2019 02:00, arubright177
Write an expression that will cause the following code to print "equal" if the value of sensorreading is "close enough" to targetvalue. otherwise, print "not equal". ex: if targetvalue is 0.3333 and sensorreading is (1.0/3.0), output is:
Answers: 1
image
Computers and Technology, 24.06.2019 10:20, savyblue1724707
Identify the publisher in this citation: carter, alan. a guide to entrepreneurship. new york: river’2008.print.
Answers: 3
image
Computers and Technology, 24.06.2019 23:00, alyssa337
What is a current gdp and what is a real gdp?
Answers: 1
Do you know the correct 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 in other subjects:

Konu
Mathematics, 28.04.2021 05:30
Konu
Mathematics, 28.04.2021 05:30