Question: in C language 8 . 1 4 LAB: Warm up: Contacts A linked list is built in this lab. Make sure to keep track of

in C language
8.14 LAB: Warm up: Contacts
A linked list is built in this lab. Make sure to keep track of the head node.
Step 1: Complete main.c to define the struct ContactNode with the following data members:
char contactName[]
char contactPhoneNumber[]
ContactNode* nextNodePtr
Step 2: Add the following functions to main.c:
void InitializeContactNode(ContactNode* thisNode, char* initialName, char* initialPhoneNumber)- Initialize thisNode with initialName and initialPhoneNumber (1 tpt)
char* GetName(ContactNode* thisNode)- Return contactName of thisNode (1 pt)
char* GetPhoneNumber(ContactNode* thisNode)- Return contactPhoneNumber of thisNode (1 pt)
void InsertAfter(ContactNode* thisNode, ContactNode* newContactNode)- Insert newContactNode after thisNode (2 pts)
ContactNode* GetNext(ContactNode* thisNode)- Return the next node of thisNode (1 pt)
void PrintContactNode(ContactNode* thisNode)- Output contactName and contactPhoneNumber of the thisNode according to the format shown in the example below.
Ex: if the name is Roxanne Hughes and the phone number is 443-555-2864, PrintContactNode() outputs:
Name: Roxanne Hughes
Phone number: 443-555-2864
Step 3: Define main() to read the name and phone number for three contacts and output each contact. Create three ContactNodes and use the nodes to build a linked list. (2 pts)
Ex: If the input is:
Roxanne Hughes
443-555-2864
Juan Alberto Jr.
410-555-9385
Rachel Phillips
310-555-6610
the output is:
Person 1: Roxanne Hughes, 443-555-2864
Person 2: Juan Alberto Jr.,410-555-9385
Person 3: Rachel Phillips, 310-555-6610
Step 4: Output the linked list in main(). Use a loop to print each node with PrintContactNode().(2 pts)
Ex:
CONTACT LIST
Name: Roxanne Hughes
Phone number: 443-555-2864
Name: Juan Alberto Jr.
Phone number: 410-555-9385
Name: Rachel Phillips
Phone number: 310-555-6610

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!