Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You must implement: string rotate_vowels(string& s); This function must accept a string parameter s by reference, and change it directly by replacing each vowel with

You must implement: string rotate_vowels(string& s); This function must accept a string parameter s by reference, and change it directly by replacing each vowel with its alphabetical successor among vowels defined circularly.

That is, replace a with e, e with i, i with o, o with u and u with a.

For example, after executing the following two lines, string s = "that's really cool";

rotate_vowels(s); the variable s should contain the string "thet's rielly cuul"

rotate_vowels(s); the variable s should contain the string "thet's rielly cuul"

In addition to changing the parameter passed in by reference, it must ALSO return this parameter.

See what happens if you implement a case-sensitive version of this function.

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

Template code: below must be in C++

  • #include

  • #include

    using namespace std; // 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

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

Step: 3

blur-text-image

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

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

How many three-digit numbers are divisible by 7?

Answered: 1 week ago

Question

What is Indian Polity and Governance ?

Answered: 1 week ago