logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Sean WooddEconomics
(4/5)

927 Answers

Hire Me
expert
Eli BishopStatistics
(5/5)

734 Answers

Hire Me
expert
Carson FisherEnglish
(5/5)

892 Answers

Hire Me
expert
Jordan CarterEngineering
(5/5)

651 Answers

Hire Me
C++ Programming

Write functionality for a linked list of strings the program consists of 3 parts a linked list of strings part of which you need to implement newTests.cpp and newTests.h files

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Problem description

Problem: Write functionality for a linked list of strings.

The program consists of 3 parts: a linked list of strings part of which you need to implement, newTests.cpp and newTests.h files where you should put tests implemented by you and driver.cpp file that contains my tests and where all the tests are run.  When you run the program it runs the main function inside driver.cpp file. The main function runs a lot of small functions that test different linked list methods, one method at a time. These functions return false if the linked list method had an incorrect behavior. I provide a lot of these functions (called tests) to you.  Use them to test your program.  In addition, you’ll need to write 2 tests per function implemented.

Your program will contain:

One class, StringList. A linked list data structure that stores strings. As every class it is split into .h and .cpp files. .h file is provided to you and you shouldn’t change it (only uncomment functions that you’ve implemented). You’ll have to write a .cpp file.

Driver.cpp file that tests your program. It’s already given to you, you don’t need to implement anything there. (but you’ll need to uncomment parts of the code as you progress with an assignment).

newTests.cpp and newTests.h. You should not change the newTests.h file in any way. You need to write the newTests.cpp file.

  • h file that contains string node structure definition. Your program should consist of the following files:

StringList.h

StringList.cpp driver.cpp newTests.h newTests.cpp StringNode.h

But you’ll need to submit only StringList.cpp and newTests.cpp files because you shouldn’t change any other files (except for uncom- menting the code I’ve provided). All other files will be disregarded.

Functions to implement

For more details about the behaviour of the functions see tests I’ve provided to you.

Copy constructor As every copy constructor initializes this object with other object. In the end, this-¿head should point to a list with different nodes that contain the same data.

Destructor Should delete all nodes in the linked list.

concatenate Should concatenate all the strings in the list ”joined” by a string provided as the parameter.

toString Should return a string that when you would print it, con- tains one string (from the linked list) per line. Hint: use concatenate function.

pushFront Should put a given string to the beginning of the linked list.

popFront Should remove a string from the beginning of the linked list. Does nothing if linked list is empty.

front Should return a first value (string) in the linked list. Re- turns an empty string when the linked list is empty.

operator+ Given other linked list it should create a new linked list that contains elements of both this linked list and other linked list. Elements from this linked list go first.

reverse Should reverse an order of the nodes in the linked list.

insert Given a string and a position it inserts a string to the position with this index. Note, that, technically, we don’t have indexing in the linked list, but we can reason about the position using an index. Returns true if insert was successful. False if it’s impossible to insert an element into this position. For example, list contains 3 nodes it’s

impossible to insert an element to the position with an index 4. But we can do it for 3, effectively the same as pushBack. 0, 1 and 2 are valid positions to insert as well.

remove Given a string and a position it removes a node with a given index from the list. Returns true if remove was successful. False if element with a given position doesn’t exist. For example, for a list that contains 3 elements, positions 0, 1 and 2 will be valid when any higher value will not be valid.

 

Tests

You’re provided with tests that your program should pass. But you need to write tests of your own. To do that, edit newTests.cpp file and implement functions declared at newTests.h file. Try to mimic tests implemented by me. But make them different at the same time. For example, if your function implementation has some if statements and none of my tests go inside this if statement, write a test that tests the code inside this if statement.

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme