Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started