Question: 1 9 . 8 Lab 0 6 & 0 7 : Contact List Overview In this lab, you will use linked lists to maintain contacts
Lab & : Contact List
Overview
In this lab, you will use linked lists to maintain contacts and their information. You will complete the ContactList class, which wraps a linked list of contacts where each Contact has a linked list of Info.
Classes
There are three classes with the following information:
class Info string name; string value; Info next; class Contact string first; string last; Contact next; Info headInfoList; class ContactList Contact headContactList; int count;
For example:
ContactList
count:
headContactList: first: Wanda
last: Maximoff
headInfoList:
next:
nullptr
first: Peter
last: Parker
headInfoList:
next: name: alias
value: SpiderMan
next:
name: color
value: redandblue
next:
nullptr
first: Natasha
last: Romanoff
headInfoList:
next: name: alias
value: BlackWidow
next:
name: birthday
value: December
next:
name: email
value: black.widow@avengers.com
next:
nullptr
first: Tony
last: Stark
headInfoList:
next: name: alias
value: IronMan
next:
name: color
value: redandgold
next:
nullptr
nullptr
Files
This project consists of three files:
main.cpp The interface that prompts for and performs actions.
ContactInfo.h Definitions of classes.
ContactInfo.cpp Implementation of the class methods in ContactInfo.h
To compile this project, use gWall main.cpp ContactInfo.cpp
You can download the templates below under Submission Instructions. Complete the class methods in ContactInfo.cpp You are allowed to modify ContactInfo.h and add additional methods to the classes. You are encouraged to write more methods and functions than those listed, but you must not change the class names or the method signatures already defined.
Approach
It is recommended to complete this project one method at a time, working from the easiest to the hardest. Each will be graded individually.
Lab addContact, addInfo, printContact, print
Lab addContactOrdered and addInfoOrdered
Lab removeInfo and removeContact
Lab destructor, copyConstructor, operator
Think about helper methodsfunctions you can write. What actions need to be repeated? What methods could be broken into several smaller methods? What methods can you call inside other methods to help solve the problem? The destructor needs to remove. The copyConstructor and operator need to add, etc.
Develop incrementally, test often.
Notes
Format your output exactly as the example.
Do not include libraries other than iostream and string.
Testing
Assume valid inputs.
To speedup testing, you can enter all commands in an input file and redirect the program input from the file: aout testtxt
aout testtxt output.txt will redirect output to the file output.txt
To make results easier to read, you can add the commandline argument no: aout no testtxt
Be sure to test your program thoroughly and check edge cases.
When testing the program, an addContact will not be combined with an addContactOrdered or an addInfo with an addInfoOrdered in the same test case.
A sample execution of the program is below to build the linked lists as illustrated in the example above. Additional examples are available in the format checker project.
Example
testtxt
addContactOrdered Tony Stark addContactOrdered Peter Parker addContactOrdered Natasha Romanoff addContactOrdered Wanda Maximoff addInfoOrdered Tony Stark alias IronMan addInfoOrdered Tony Stark color redandgold addInfoOrdered Peter Parker alias SpiderMan addInfoOrdered Peter Parker color redandblue addInfoOrdered Natasha Romanoff birthday December addInfoOrdered Natasha Romanoff email black.widow@avengers.com addInfoOrdered Natasha Romanoff alias BlackWidow print quit
aout no testtxt Contact Name: Wanda Maximoff Contact Name: Peter Parker alias SpiderMan color redandblue Contact Name: Natasha Romanoff alias BlackWidow birthday December email black.widow@avengers.com Contact Name: Tony Stark alias IronMan color redandgold
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
