Question: class Powerstring { public: // constructor: initialize str with ini_str passing as a parameter PowerString(string ini str): // return a reversed string. Note that str

class Powerstring { public: // constructor: initialize str with ini_str passing as a parameter PowerString(string ini str): // return a reversed string. Note that str has not been changed string reverse(): // return a palindrome which contains str then followed by // the reverse of str //for example, if str is "abc", it returns "abccba" // Note that str has not been changed string evenPalindrome(): // return a palindrome which contains str, then followed by // the reverse of str, except for the last character of str //for example, if str is "abc", it returns "abcba" // Note that str has not been changed string oddPalindrome (): // displays str, followed by a new line marker, //to the standard output void print(): private: string str: }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
