Question: Objectives: This assignment will access your CH+ language skills and understanding of linked lists. After completing this assignment you will be able to do the





Objectives: This assignment will access your CH+ language skills and understanding of linked lists. After completing this assignment you will be able to do the following: (1) Manage a singly-linked list with pointers to the front and back of the singly-linked list, (2) allocate memory dynamically (3) implement a default, explicit-value and copy constructors, (4) a destructor, (5) add a node to a singly-linked list, and (6) delete a node anywhere in a singly-linked list. In this assignment you will implement the SENTENCE ADT (abstract data type) using a singly- linked list of strings. The SENTENCE ADT is defined below. Call the class you implement "sentence". Remember, a singly-linked list is composed of nodes. You will also implement a class called "word" that has two fields: a string field called "term"; and a pointer field called "next". Essentially, each word is really a node in the linked list. And sentence is the singly-linked list. Each node (word) in the linked list (sentence) will contain one string of a sentence. Note that a space is considered a string. Consider the following declaration of a word. A sentence is composed of words: class word { public: string term; word *next; }; The state (private data members) of your sentence class should contain a pointer to the front of the list of words called "front" and a pointer to the back of the list called "back". You may add more members to the state and more member functions to the behavior of the class if you determine necessary. Store the definition of your class in a file called "sentence.cpp." and the declaration of your class in a file called "sentence.h." You will implement all the code necessary to maintain a sentence. See the ADT below. Test the complete functionality of the class sentence. You must use the file "sentence_driver.cpp" to help you understand and test all the required functionality of the class. If you discover that you need more tests while implementing the functionality of the sentence class, then add more tests to your driver, but your final code must be submitted with the given driver . #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
