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
Get step-by-step solutions from verified subject matter experts
