Need help plz experts or someone
here is instructions:
File Processing
Make a Mad Libs party game. The leader has the text of a short story with a few missing words in it. The missing words are tagged by their function [noun], [verb], [place], etc... For example:
It was a [adjective] summer day.
Jack was sitting in a [place].
The leader examines the text and prompts the players for the missing words:
Please give me a/an:
adjective
place
etc...
He then reads the text with the supplied words inserted into their places.
Write a program that acts as the Mad Libs leader. It should prompt the user for a file name (or display a menu of available files), read the text from the chosen file, find the tags for the missing words, prompt the user for the words, and, finally, find the completed text in another file. You MUST use apstring, and, at least 2 funstions. In addition, use the <fstream.h> header file for the class ifstream. You will need to use the open, close, eof, and fail functions.
The files that i use will include the following: Holdiday, Noun, Verb, Food, Person, Adjective. All words tagged by [ ].
Code:
#include<iostream>
#include<iomanip>
#include<fstream>
#include"vector"
#include"string"
using namespace std;
//Mad Lib
//Daniel Meade
int main()
{
ifstream fin;
ofstream fout;
string filename, line;
char temp;
do
{
fin.clear();
cout << "What is the file name";
getline(cin, filename);
fin.open((filename).c_str());
if(fin.fail())
cout << "Not valid file." << endl;
}while(fin.fail());
while(!fin.eof())
{
vector<string>story(19,"");
vector<string>word(18,"");
getline(fin,line);
if(line.find('[') == 1)
{
if(int x=0; x<=18; x++)
line = word[x];
}
else
{
if(int y=0; y<=18; y++)
cout << "enter a word" << word[x] <<":"<< endl;
cin >> word [x];
}
if(int y=0; y<=18; y++)
{
cout << story[y];
if(int x=0; x<=18; x++)
cout << word[c];
}
}
fin.close();
}
}
file input
TWas the night before
[Holday]
and all through the
[Noun],
not a
[Noun]
was
[Verb]
,not even a
[Noun].
All the children were tucked all snug in their
[Noun],
with visions of
[Food]
dancing in their heads.The stockings were hung by the chimney with
[Verb],
in hopes that
[Person]
soon would be there.I in my kerchief and ma in her
[Noun],
had just
[Verb]
down for a
[Adjective]
winter's nap.When up on the roof on I
[Verb]
such a
[Adjective]
,I jumped from my bed to
[Verb]
what was the matter.When what do my
[Adjective]
eyes do appear,but a
[Noun]
and eight
[Adjective]
reindeer.
Errors:
parse error before ';' token on a bunch of lines what does this mean?