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