Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hey everyone, This program has been bothering me. It basically takesa file and c

ID: 3617085 • Letter: H

Question

Hey everyone,   This program has been bothering me. It basically takesa file and converts it to html. I am posting the questionbelow.
 Write a program that reads in a C++ source file and converts all < symbolsto &lt; and all > symbols to &gt;  .  Also add the tag <PRE> to the beginningof the file and </PRE> to the end of the file.  This tag preserves whitespaceand formatting in the HTML document.  Your program should output the HTMLfile to disk.As an example, given the following input file:#include <iostream>int main(){int x=4;if (x < 3) x++;cout << x << endl;}The program should produce a textfile with the following contents:<PRE>#include &lt;iostream&gt;int main(){int x=4;if (x &lt; 3) x++;cout &lt;&lt; x &lt;&lt; endl;}</PRE>
 I am also posting my source code below, please help me out.
 #include <iostream>#include <fstream>#include <cstring>#include <string>using namespace std;int main(){const int size=51;char fileName[size];          // Input file to convertchar outputname[size];    // Output file with .html on the endchar c;int i;ifstream inStream;ofstream outStream;cout << "Enter filename to convert: " << endl;cin >> fileName;inStream.open(fileName,ios::in);outStream.open("outfile.html");inStream.close();outStream.close();cout << "Conversion done.  Results in file " << outputname << endl;system("pause");return 0;}
  This program has been bothering me. It basically takesa file and converts it to html. I am posting the questionbelow.
 Write a program that reads in a C++ source file and converts all < symbolsto &lt; and all > symbols to &gt;  .  Also add the tag <PRE> to the beginningof the file and </PRE> to the end of the file.  This tag preserves whitespaceand formatting in the HTML document.  Your program should output the HTMLfile to disk.As an example, given the following input file:#include <iostream>int main(){int x=4;if (x < 3) x++;cout << x << endl;}The program should produce a textfile with the following contents:<PRE>#include &lt;iostream&gt;int main(){int x=4;if (x &lt; 3) x++;cout &lt;&lt; x &lt;&lt; endl;}</PRE>
 I am also posting my source code below, please help me out.
 #include <iostream>#include <fstream>#include <cstring>#include <string>using namespace std;int main(){const int size=51;char fileName[size];          // Input file to convertchar outputname[size];    // Output file with .html on the endchar c;int i;ifstream inStream;ofstream outStream;cout << "Enter filename to convert: " << endl;cin >> fileName;inStream.open(fileName,ios::in);outStream.open("outfile.html");inStream.close();outStream.close();cout << "Conversion done.  Results in file " << outputname << endl;system("pause");return 0;}

Explanation / Answer

please rate - thanks #include #include #include #include using namespace std; int main() { const int size=51; charfileName[size];         // Input file to convert string outputname;    // Output file with .html onthe end char c; int i; ifstream inStream; ofstream outStream; cout