Question: It C++ // pig.cpp : // Barrett Koster 2019 // lab to translate to pig latin // #include stdafx.h #include #include using namespace std; /*







It C++
// pig.cpp : // Barrett Koster 2019 // lab to translate to pig latin
// #include "stdafx.h" #include
/* // return true iff c is a vowel // just assume lower case for now, and don't // worry about 'y'. bool isVowel(char c ) { // YOUR CODE HERE }
// returns a string which is the input w with // initial consonants stripped off the front string decap( string& w ) { // YOUR CODE HERE // recommendation: use the structure of initialConsonants // below for a start. }
// returns a string which is the first part // of w, all of the consonants up to but not // including the first vowel. If the word // begins with a vowel, it returns the empty // string. string initialConsonants( string& w ) { string r = ""; // string to be output bool done=false; // we are done reading from w when // we hit the first vowel // index through the string. copy non-vowels to // the output string, loops is done when we hit // the first vowel. for ( int i=0; i
// returns a string which is w translated into // piglatin (consonants stripped off the front // end and added to the backend with "ay". string translate(string& w ) { string r; // r is made from the original word with the consonants // trimmed off (use decap()), the initial consonants // (use initialConsonants()), and then "ay". // YOUR CODE HERE // recommended stub: just return w until you get the // rubber stamp loop running in main(). return r; } */ bool check( string c ) // string change { if ( c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'); // check it is vowel { // for ( int i = 0; i
cout 1.14 Pig Latin Complete the program below that translates what the user types into Pig Latin. If you don't know, Pig Latin words are formed from English words by moving initial consonants from the front of the word to the back and adding "ay". Example: work becomes orkway", and stronger" becomes ongerstray". Look for your code here" in the code below LAB 1.14.1: Pig Latin 0/2 main.cpp Load default template... 1 // pig.cpp 2 / Barrett Koster 2019 3 // lab to translate to pig latin 4 5 // #include "stdafx.h" 6 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
