Answered step by step
Verified Expert Solution
Link Copied!

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
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

Explain the relationship of job design to employee contributions.

Answered: 1 week ago

Question

Discuss the steps in human resource planning.

Answered: 1 week ago