Need hints to design a program

You are given a file. Convert the file into MPLF form and write the ourput into another file. The rules for converting a word into MPLF form are as follows:
If the word begins with a vowel, add the string "yay" at the end of the word. For example, the MPLF form of the word "eye" is "eyeyay".
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. Then add the string "ay" at the end. For example, the MPLF form of the string "There" is "ereThay".
Strings such as "by" contain no vowels. In cases like this, the letter y can be considered a vowel. Assume that the vowels are a, e, i, o , u, y, A, E, I, O, U, and Y. Therefore the MPLF form of "by" is "ybay".
For words such as "crwth" which contain no vowels, the MPLF form adds the string "way" at the end of the word. Thus "crwth" becomes "crwthway". 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. For example, the MPLF form of "Hello!" is "elloHay!".
Write a program that takes a file and converts its contents into MPLF form. Assume that the text contains the following punctuation marks: , (comma), . (period), ? (question mark), ; (semi-colon), and : (colon). Write the converted words to an output file called textfileMPLF.txt.

I don't have much. I have only extracted each word from the input file (a text) and i'm intended to store each word into an array. My question is.. i'm doing this ina logical way? am i in the right track?... Please give me some hints to write this program


#include <iostream>
#include <string>
#include <fstream>

using namespace std;

int main()
{

ifstream inData;
ofstream outData;
string filename;
string word;
string WORD[];

cout << "Enter the name of the file: " << endl;
cin >> filename;
inData.open(filename.c_str());
outData.open("textfileMPLF.txt");


while (inData >> word)
{
WORD[]=word;
outData << word[];
}
return 0;
}
Topic archived. No new replies allowed.