I keen to write a program that reads a text from a file. Then i have to take each word from the text and change the word.
If the word begins with a vowel, add the string "yay" at the end of the word.
If the word does not begin with a vowel, rotate the word one character at a time; that is, move the first character of the word to the end of the word until the first character of the word becomes a vowel. "There" = "ereThay".
For words such as "crwth" which contain no vowels, the MPLF form adds the string "way" at the end of the word. The same applies to numbers.
If a word ends with a punctuation mark, in the MPLF form put the punctuation mark at the end of the word. "Hello!" = "elloHay!".
Write the converted words to an output file called textfileMPLF.txt.
so far i have gotten the words invividually....what do i do next?
please help!
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
ifstream inData;
ofstream outData;
string filename;
string word;
cout << "Enter the name of the file: " << endl;
cin >> filename;
inData.open(filename.c_str());
outData.open("textfileMPLF.txt");
while (inData >> word)
{
outData << word<<endl;
}
return 0;
}