Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Original problem... Here is the current code.... #include #include using namespace std; bool isVowel(char ch) { if(ch == 'a' || ch == 'A' || ch

Original problem...

image text in transcribed

Here is the current code....

#include #include

using namespace std;

bool isVowel(char ch) { if(ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' || ch == 'I' || ch == 'o' || ch == 'O' || ch == 'u' || ch == 'U' ) { return true; } else { return false; }

}

int vowelIndex(string str){ for(int i = 0; i

string pigLatin(string str){ string latin = ""; int index = vowelIndex(str); if(index == -1 || index == 0){ return str + "ay"; } else{ return str.substr(index) + "-" + str.substr(0, index) + "ay"; } }

int main() { string wtf; cout > wtf;

cout

return 0; }

I need help changing this to convert phrases and sentences, not just the first word. Also, adding some comments explaining what was done would be great!

Write a C++ Program for (Pig Latin) A language game, such as Pig Latin, alters spoken words to make them incomprehensible to the untrained ear. Write a program to prompt the user for an English word, phrase, or sentence and then translate the words into Pig Latin, as follows: the initial consonants are moved from the front of the word to the end and the letters "ay" are then added to the end. Thus meal" becomes "eal-may", "scram" becomes "am-scray", and "java" becomes "ava- jay". If the word begins with a vowel, then just add "ay" to the end

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

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

4. This problem has been intentionally omitted for this edition.

Answered: 1 week ago