Question: You are to create your own version of a string class named myString. myString will store a character string of up to 25 characters (how

You are to create your own version of a string class named myString.

myString will store a character string of up to 25 characters (how will you handle more than 25?).

The “string” of characters must be stored in a linked list. You will also need to supply the following methods as part of your class include a reference “status variable” for errors:

size() – returns how many characters are in the string (empty string is size zero)

addStart(myString) – will add the string in the input parameter to the front of current string (cannot exceed 25)

addEnd(myString) – will add the string in the input parameter to the end of the current string (cannot exceed 25)

partString(startPos, length) – returns string from startPos for length given (handle startPos < 0, startPos = size returns null string, handle startPos > size)

replPartString(myString, startPos) – replaces charaters starting at startPos with input string – (what if exceeds 25?)

replWholeString (myString) – replaces what is currently in string with input parameter string

compareString(myString) – compare current value of string with input parameter string.

initString() – resets/initializes string to null string

setString(string) – assign string to myString data value

getString() – returns string of data from myString data value

printStringScreen() – prints myString data value to the monitor

numericString() – is the string an integer or real (signs, decimal point. etc.)

alphabeticString() – is the string all alpabetic characters

You may use the C++ string class only for screen input and the setString method.

Write a main that will test all of the functionalities of the myString class displaying the actions on the screen and an output file. The main should use a method to write out the results to the file.

Output file log of actions must show action, original value of myString, parameters/results, success/error message.

You determine format and error messages – format into columns for readability

Step by Step Solution

3.40 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Creating your own version of a string class named myString using a linked list can be an exciting challenge Ill guide you through the steps you could take to implement this class including how to hand... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!