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
LAB: Warm up: Contacts
A linked list is built in this lab. Make sure to keep track of the head node.
Step : Complete main.c to define the struct ContactNode with the following data members:
char contactName
char contactPhoneNumber
ContactNode nextNodePtr
Step : Add the following functions to main.c:
void InitializeContactNodeContactNode thisNode, char initialName, char initialPhoneNumber Initialize thisNode with initialName and initialPhoneNumber tpt
char GetNameContactNode thisNode Return contactName of thisNode pt
char GetPhoneNumberContactNode thisNode Return contactPhoneNumber of thisNode pt
void InsertAfterContactNode thisNode, ContactNode newContactNode Insert newContactNode after thisNode pts
ContactNode GetNextContactNode thisNode Return the next node of thisNode pt
void PrintContactNodeContactNode 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 PrintContactNode outputs:
Name: Roxanne Hughes
Phone number:
Step : 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. pts
Ex: If the input is:
Roxanne Hughes
Juan Alberto Jr
Rachel Phillips
the output is:
Person : Roxanne Hughes,
Person : Juan Alberto Jr
Person : Rachel Phillips,
Step : Output the linked list in main Use a loop to print each node with PrintContactNode pts
Ex:
CONTACT LIST
Name: Roxanne Hughes
Phone number:
Name: Juan Alberto Jr
Phone number:
Name: Rachel Phillips
Phone number:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
