Question: Step 1 Implement the following class header file ( i . e . write the cpp file ) . You may add any other properties

Step 1
Implement the following class header file (i.e. write the cpp file).
You may add any other properties and/or methods that you need. You might want to check with me before adding them just to make sure you're on the right track.
Write a main function that will test all the different methods. Make sure your main function is easy to read and understand. I recommend you use regions and procedures to break up the logic. You can easily comment out a call to previously made procedures so you can test only the current procedure that you are working on.
You may use any string functions you want (e.g. strlen, strstr, etc).
You may not use the built-in String class.
In addition to the methods listed below, overload the following operators with all reasonable parameters (i.e. char, const char *, CSuperString &): ==,!=,>,<,>=,<=.
NONE of the class methods other than the constructors or the assignment operators (= and +=) should change m_pstrSuperString.
You must assign the value back to the class instance to make it permanent. For example:
ssBuffer = ssBuffer.ToUpperCase();
Minus one letter grade for any memory leak. Minus two letter grades if there are a lot of memory leaks.
Minus one letter grade if replace with substrings doesn't work correctly.
Minus one letter grade if self assignment doesnt work correctly (e.g. ssBuffer = ssBuffer.ToUpperCase(); ).
Minus one letter grade if you don't solve the double call problem. The following should display correctly:
printf( "Left(2): %s, Left(4): %s
", ssBuffer.Left(2), ssBuffer.Left(4));
Splitting the code up into two lines is not the solution.
Add the following procedure to your tests and make sure it executes without errors.
void MuahahahTest1()
{
CSuperString ssTest;
cout <<Muahahah Test #1: << ssTest << endl;
}
Add the following procedure to your tests and make sure it executes without errors.
void MuahahahTest2()
{
CSuperString ssTest = "I Love Star Wars and I Love Star Trek";
ssTest = ssTest.Replace( "Love","Really Love Love" );
cout <<Muahahah Test #2: << ssTest << endl;
}
I recommend you start with just the following methods, get those working and code, test and run additional methods one at a time: constructor, initialize, assignment operator, deep copy, to string and print.
Next, Id recommend you get all the other constructors done.
After that, Id recommend you get all the to methods done.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!