Question: Q1. Strings and Class Design. [35 points] The string class is provided in the C++ library. Provide your OWN implementation for the following functions in
![Q1. Strings and Class Design. [35 points] The string class is](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4e5815d898_56866f4e580c4095.jpg)
Q1. Strings and Class Design. [35 points] The string class is provided in the C++ library. Provide your OWN implementation for the following functions in a new string class with additional features. Name your class MyString. You do not need to provide any other functions other than those listed below. The below prototypes should appear on your header file (MyString.h) and you should implement the functions in MyString.cpp MyString(char chars[], int size); //constructor void append(int n, char ch) //appends n copies of character ch at the end of the MyString object void assign(MyString s, int n); //assigns the first n number of characters of s into this MyString object, starting from the first character in this object int partCompare(MyString s, int n); //returns a value greater than 0, 0, or less than 0 if this MyString object is greater than, equal to, or less than the first n characters of s, respectively MyString commonPrefix(const MyString &s) //returns the common prefix () of this MyString object and s, if any. Returns an empty MyString otherwise. (*) Newton and Newark have the common prefix "New", ABC and abc do not have a common prefix (case sensitive), coding and cod have the common prefix "cod". Make sure to test your MyString class thoroughly, but do not include your test code in your submission
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
