C Programming Needed Need Change Pig Latin Program C Word Starts Vowel Adds Way End Also I Q37108604

C++ programming needed.

I need to change this pig latin program in c++

so that when the word starts with a vowel, it adds “-way” to theend.

Also, if the input is over 2 lines, the output must also be over2 lines.

#include <fstream>
#include <string>

using namespace std;

bool isVowel(char c)

{

return (c == ‘A’ || c == ‘E’ || c == ‘I’ ||

c == ‘O’ || c == ‘U’ || c == ‘a’ ||

c == ‘e’ || c == ‘i’ || c == ‘o’ ||

c == ‘u’);

}

string pigLatin(string s)

{

// the index of the first vowel is stored.

int len = s.length();

int index = -1;

for (int i =

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.