Question
C++ Lab Instructions You are to create your own version of a string class named myString. myString will store a string of characters (use dynamic
C++ Lab Instructions
You are to create your own version of a string class named myString.
myString will store a string of characters (use dynamic memory).
Include a reference status variable for errors.
You will also need to supply the following methods as part of your class:
size() returns how many characters are in the string (empty string is size zero)
addStart(myString) adds the string in the input parameter to the front of current string
addEnd(myString) adds the string in the input parameter to the end of the current string
partString(startPos, length) returns as myString that portion from startPos for length given (handle startPos < 0, startPos = size returns null string, handle startPos > size)
replPartString(myString, startPos) replaces characters starting at startPos with input string
replWholeString (myString) replaces current string data value 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() returns Boolean telling if data value is either integer or real (signs, decimal point. etc.)
alphabeticString() returns Boolean telling if data value is all alphabetic characters
You may use the C++ string class only for screen input and the setString & getString methods.
Write a main that will test all of functionalities of the myString class, displaying the actions both on the screen and to an output file. Main must use a myString method to write the results to the file.
Create an output file log of actions, which 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
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started