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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:00, alyssashae1818
Which parts of a presentation should be the most general? a. introduction and conclusion b. introduction and outline c. outline and conclusion d. outline and body
Answers: 1
image
Computers and Technology, 23.06.2019 00:30, devenybates
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
image
Computers and Technology, 23.06.2019 02:00, HannahVance99
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
image
Computers and Technology, 23.06.2019 21:30, quintonps12
Which of the following includes the three primary network access technologies? dsl, cable modem, broadband lan, wan, man voip, uc, iptv tcp/ip, ftp, dhcp
Answers: 2
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 in other subjects:

Konu
Mathematics, 01.09.2019 12:30