Question: In C++, Write a function that converts a string to its Pig-latin equivalent. To convert a string to Pig-latin use the following definition of Pig-latin:

In C++, Write a function that converts a string to its Pig-latin equivalent. To convert a string to Pig-latin use the following definition of Pig-latin:

1. If the string begins with a vowel, add "way" to the string. For example, Pig-latin for "orange" is "orangeway".

2. Otherwise, find the first occurrence of a vowel, move all the characters before the vowel to the end of the word, and add "ay". For example, Pig-latin for "story" is "orystay" since the characters "st" occur before the first vowel.

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!