Question: You must implement: string lispify(string s); When I invoke this method, I will supply it a string parameter. You must accept this parameter by copy

You must implement:

string lispify(string s);

When I invoke this method, I will supply it a string parameter. You must accept this parameter by copy (not reference). Look it up or ask and understand before proceeding.

It must return a string which is identical to the one I gave you except that all s's in the string have been substituted by th's. For example:

lispify("sixty six")

shouldreturnthestring"thixtythix". Yeah,Iknowthere'sanssoundinthex,butleaveitalone in this quest.

Once you have this working, try to see if you can implement a case-sensitive version. It's identical to the previous version except that upper-case S must get replaced by "Th", not "th".

Useful guide: If your code for this function is over 10 lines including comments, look for signs of over-coding.

Template Code: // must be done in c++

  • #include #include

    using namespace std; 
    // Return a new string in which the letters (lowercase) a, e, i, o, and u 
  • // have been replaced by the next vowel in the sequence aeiou. Replace u by a. //

  • // Note that the string is passed in by reference. So the caller may not

  • // rely on the result being returned.

  • // TODO - Your code for rotate_vowels goes here

    // Return a string in which all occurrences of s have been replaced by th 
  • }

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 Databases Questions!