Question: C++ programming 1) Create a text processing class - textClass, by implementing a double-linked list of chars This should be a class that allows you
C++ programming





1) Create a text processing class - textClass, by implementing a double-linked list of chars This should be a class that allows you to input a single character at a time, list the resulting characters, find any character, and delete the first example of a character. There is example code in Moodle that provides much of this functionality for integers The first set of tests in the driver is of this basic double-linked list- it checks insertHead, insertTail, deleteHead, and deleteTail The main change from the example code is that you are to have a variable in your class named iter that is a pointer to a link. The second block of test code in the driver tests this functionality. The variable iter is initialized to nullptr, set to point to a link when findKey succeeds, and used in insertKey and deletelter The functionality of findKey is similar to the find function in Word or any other text processing program it finds the first link containing its argument, then if called again finds the next link, and ultimate loops back around to find the first instance again. If findKey fails to find the value, it should return false and set iter to nullptr. For example, given the list containing the letters ABCADAF and the following series of calls to findKey 1. findKey(A) would succeed and iter would point to the first A. 2. findKey(A) would see that iter is pointing to A, start searching at the next link, 3. findKey(G) would see that iter is not pointing to a G, start at the beginning, fail 4. findKey(B) would see that iter is equal to nullptr, start at the beginning, succeed 5. findKey(B) would see that iter points to a B, start with the next link, go to the 6. findKey(A) would see that iter points to a B, start at the beginning and succeed succeed and iter would point to the second A. and iter would be set to nullptr. and iter would point to the B end, wrap, and then succeed with iter pointing to the B pointing to the first A. There are two delete methods: deleteKey deletes the first link containing its argument, it returns true on success and false if that value is not found. This is the normal delete method that is included in the example code o 1) Create a text processing class - textClass, by implementing a double-linked list of chars This should be a class that allows you to input a single character at a time, list the resulting characters, find any character, and delete the first example of a character. There is example code in Moodle that provides much of this functionality for integers The first set of tests in the driver is of this basic double-linked list- it checks insertHead, insertTail, deleteHead, and deleteTail The main change from the example code is that you are to have a variable in your class named iter that is a pointer to a link. The second block of test code in the driver tests this functionality. The variable iter is initialized to nullptr, set to point to a link when findKey succeeds, and used in insertKey and deletelter The functionality of findKey is similar to the find function in Word or any other text processing program it finds the first link containing its argument, then if called again finds the next link, and ultimate loops back around to find the first instance again. If findKey fails to find the value, it should return false and set iter to nullptr. For example, given the list containing the letters ABCADAF and the following series of calls to findKey 1. findKey(A) would succeed and iter would point to the first A. 2. findKey(A) would see that iter is pointing to A, start searching at the next link, 3. findKey(G) would see that iter is not pointing to a G, start at the beginning, fail 4. findKey(B) would see that iter is equal to nullptr, start at the beginning, succeed 5. findKey(B) would see that iter points to a B, start with the next link, go to the 6. findKey(A) would see that iter points to a B, start at the beginning and succeed succeed and iter would point to the second A. and iter would be set to nullptr. and iter would point to the B end, wrap, and then succeed with iter pointing to the B pointing to the first A. There are two delete methods: deleteKey deletes the first link containing its argument, it returns true on success and false if that value is not found. This is the normal delete method that is included in the example code o
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
