Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MyString class addition, equality, and stream insertice In this assignment, you are to create MyString class that supports custom operators, such as and extraction. Following

image text in transcribed
MyString class addition, equality, and stream insertice In this assignment, you are to create MyString class that supports custom operators, such as and extraction. Following describes the member functions and operators of the MyString class: // default constructor /I constructor: creating a string from a char . MyString); MyString(const char src) MyString(const char* sre) /I constructor: creating a string from c-strine // copy constructor // destructor . Mystring(const MyStrings sre) . MyString) int Get Length() const; . char GetChart (int index) const; . void SetCharat (nt index, char ch) const // getter // getter // setter I copy assignmnent operator II copy assignment operator II copy assignment operator /I addition operator // addition operator MyStrings operatore (const char rhs); Mystrings operator (const char rhs); MyStrings operator (const Mystrings rhs); MyString operator+ (const char rhs) const; MyString operator+ (const char* rhs) const; MyString operator+ (const Mystrings rhs) const; 11 addition operator MyStrings operator+ (const char rhs); MyString& operator-(const char* rhs): MyStrings operator+.(const MyString& rhs) /I addition assignment operator /I addition assigneent operator // addition assignment operator // equal-to operator // equal-to operator II not-equal-to operator II not-equal-to operator . bool operator-(const Mystring& rhs) const; .bool operator(const char* rhs) const . bool operator!-(const Mystring& rhs) const; bool operatorl (const chan* rhs) const; friend ostrean& operator (istreans is, MyString& str); You are provided with three startup files: // stream extraction operator /home/cmpsc122/s19/hw3/mystring.h home/capsc122/s19/hw3/mystring.cxx /home/cmpsc122/s19/hw3/testmystring.cxx mystring.h has the class declaration, mystring.cxx has the implementation of member functions and operators, and testmystring.cxx has the main program that tests your MyString class. In thi implementation of the member functions and operators in mystring.cxx. Do not change any code in mystring.h and testmystring.cxx. To compile and run the program, use the following commands: s assignment, you have to complete the s g++ -ansi -pedantic -Nal1 mystring.cxx testmystring.cxx -o testmystring s./testmystring If you passall tets in testmystring.cxx, the following messages will be printed at the end of its output. Congratulation! Your program passed all 3e test cases. herwise, the program will output the number of test cases your program failed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Database Theory Icdt 99 7th International Conference Jerusalem Israel January 10 12 1999 Proceedings Lncs 1540

Authors: Catriel Beeri ,Peter Buneman

1st Edition

3540654526, 978-3540654520

More Books

Students also viewed these Databases questions

Question

Describe the biopsychosocial approach to individual development.

Answered: 1 week ago

Question

4. Are there any disadvantages?

Answered: 1 week ago

Question

3. What are the main benefits of using more information technology?

Answered: 1 week ago

Question

start to review and develop your employability skills

Answered: 1 week ago