Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

include include using namespace std int count0 public ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Using Microsoft Excel and Access 2016 for Accounting

Authors: Glenn Owen

5th edition

1337109048, 1337109045, 1337342149, 9781337342148 , 978-1337109048

More Books

Students also viewed these Programming questions

Question

Define the purpose of neuropsychological testing.

Answered: 1 week ago

Question

What do solvency ratios represent?

Answered: 1 week ago