I need help with a homework assignment. The assignment is to take a paragraph from an infile and change the words French into Freedom. Also when the phrase "an arbitrary end point" is seen I need to end the paragraph. And also if an integer if present the integer needs to be replaced with correct # symbols. i.e. 3 = ###. I then need to output the new paragraph to the screen. Here is my code as of now:
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <cmath>
#include <string>
using namespace std;
int main (int argc, char *argv[])
{
string strInput;
string sentence;
ifstream inFile;
inFile.open("data.txt");
inFile>>strInput;
while (inFile)
{
sentence = sentence +strInput + " ";
inFile >> strInput;
if (sentence == "French")
string sentence.replace ("French", "Freedom");
if sentence == "an arbitrary end point")
string sentence.replace ("an arbitrary end point", '\n');
}
cout << sentence;
system ("PAUSE");
return EXIT_SUCCESS;
}