Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1 : Implement and test a linked listYour program should have the following classes / structsLinkedList Node You should have a . h and
Part : Implement and test a linked listYour program should have the following classesstructsLinkedList Node You should have a h and cpp file for the LinkedList. Node can be a struct it has no member functions and it can be defined inside the LinkedList.h file before the LinkedList class, as that class has a member of type NodeThe linked list class should implement the following methods public functions:Constructorinsertstring inserts the given string in the list in alphabetical order if its not already there. Returns true if successful, false otherwise. No duplicates are allowed.print prints the list inorder all on one line, comma delimited; no comma at the end, a newline insteadThis is the only function that produces output on the console.count returns a count of the number of strings in the list.Additional detailsProgram should be named LinkedListDemo.Your LinkedList class should have a constructor and destructor destructor should delete every nodeThe only linked list method that should produce output to the screen is printMake sure you use const on all input parameters and accessor methods.Define a main in a separate cpp file named LinkedListDemo; add code to main to test your classs functions.Part : Processing text fileThis portion makes use of the linked list you created in part Each linked list function should be written and thoroughly tested before doing this part.Replace all previous test code with code that opens and reads from a file named linkListTest.txt and performs the linked list operations specified on each line of the file. Each line will begin with a character denoting what action to perform, and if required by that action, a string. Those two pieces of data will be space delimited. Valid actions are:a Add the string to the listr Remove the string from the listP Print how many strings are in the list and the list of strings followed by a blank linef Find the string in the listR Remove all entries from the listAn example data file, and corresponding output, is shown below. Data FileOutput sent to cout a Billa Adama Zorroa BillPAdded BillAdded AdamAdded ZorroBill cannot be added againList Contains names: Adam, Bill, ZorroProgram should be well written, function properly, and be both easy and efficient to use. linkedListDemo.cpplinklist.hlinklist.cpplinkListTest.txt you MUST process a file with the exact name linkListTest.txtAnd the executable your executable name might be differentlinkedListDemoexe. Write in C
:
Search
Part : Implement and test a linked list
Your program should have the following classesstructs
LinkedList
Node
You should have a h and cpp file for the LinkedList. Node can be a struct it has no member functions and it can be defined inside the LinkedList.h file before the LinkedList class, as that class has a member of type Node
The linked list class should implement the following methods public functions:
Constructor
insertstring inserts the given string in the list in alphabetical order if it's not already there. Returns true if successful, false otherwise. No duplicates are allowed.
print prints the list inorder all on one line, comma delimited; no comma at the end, a newline instead
This is the only function that produces output on the console.
count returns a count of the number of strings in the list.
Additional details
Program should be named LinkedListDemo.
Your LinkedList class should have a constructor and destructor destructor should delete every node
The only linked list method that should produce output to the screen is print
Make sure you use const on all input parameters and accessor methods.
Define a main in a separate cpp file named LinkedListDemo; add code to main to test your class's functions.
:
Search
Part : Processing text file
This portion makes use of the linked list you created in part Each linked list function should be written and thoroughly tested before doing this part.
Replace all previous test code with code that opens and reads from a file named linkListTest.txt and performs the linked list operations specified on each line of the file. Each line will begin with a character denoting what action to perform, and if required by that action, a string. Those two pieces of data will be space delimited.
Valid actions are:
a Add the string to the list
Remove the string from the list
Print how many strings are in the list and the list of strings followed by a blank line f Find the string in the list
Remove all entries from the list
An example data file, and corresponding output, is shown below.
tableData File,Output sent to couta Bill,Added Billa Adam,Added Adama Zorro,Added Zorroa Bill,Bill cannot be added againPList Contains names: Adam,
Program should be well written, functio
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