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 #include using namespace

std; /* // 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

It C++

// pig.cpp : // Barrett Koster 2019 // lab to translate to pig latin

// #include "stdafx.h" #include #include using namespace std;

/* // 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 8 using namespace std; 10 11 // return true iffcis a vowel 12 / just assume lower case for now, and don't 13 /I worry about 'y 14 bool isVowel(char c ) 15 16 II YOUR CODE HERE 17 18 19 20 // returns a string which is the input w with 21 // initial consonants stripped off the front 22 string decap( string& w) 23 24 YOUR CODE HERE 25 / recommendation: use the structure of initialConsonants 26 // below for a start. 27 28 29 30 returns a string which is the first part 31 // of w, al1 of the consonants up to but not 32 // including the first vowel. If the word 33 begins with a vowel, it returns the empty 34 / string 35 string initialConsonants( string& w) 36 37 string r-""; /I string to be output bool done-false; I/ we are done reading from w when // we hit the first vowel 40 // index through the string. copy non-vowels to /the output string, loops is done when we hit // the first vowel 42 43 for (int i-0; i

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!