C++ PROGRAMMING Create a C++ program that accepts an English sentence and converts it to Pig Latin. The rules of Pig Latin are as follows: If the word starts with a vowel, add the word "yay" in the end. If the word starts with a consonant, move the first letter of the word in the end and add "ay" in the end. If the word starts with a capital letter, follow the rule and convert the first letter of the converted Pig Latin word into a capital letter. (i.e. Hello -> ElloHay) If there are numbers in the sentence, they should not be translated. A word with a combination of letters and numbers will not be tested. Spacing and punctations must be preserved. Sample Input: A quick brown fox jumps over the 100 lazy dogs. Expected Output: Ayay uickqay rownbay oxfay umpsjay overyay hetay 100 azylay ogsday.
C++
Create a C++ program that accepts an English sentence and converts it to Pig Latin. The rules of Pig Latin are as follows:
If the word starts with a vowel, add the word "yay" in the end. If the word starts with a consonant, move the first letter of the word in the end and add "ay" in the end.
If the word starts with a capital letter, follow the rule and convert the first letter of the converted Pig Latin word into a capital letter. (i.e. Hello -> ElloHay)
If there are numbers in the sentence, they should not be translated. A word with a combination of letters and numbers will not be tested. Spacing and punctations must be preserved.
Sample Input:
A quick brown fox jumps over the 100 lazy dogs. Expected
Output:
Ayay uickqay rownbay oxfay umpsjay overyay hetay 100 azylay ogsday.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images