Problem

HTML files use tags enclosed in angle brackets to denote formatting instructions. For exam...

HTML files use tags enclosed in angle brackets to denote formatting instructions. For example, indicates bold and indicates italics. If a web browser is displaying an HTML document that contains, it may mistake these symbols for tags. This is a common problem with C++ files, which contain many <’s and >’s. For example, the line "#include " may result in the browser interpreting as a tag.

To avoid this problem, HTML uses special symbols to denote. The symbol is created with the string >.

Write a program that reads in a C++ source file and converts all symbols to >. Also add the tag

to the beginning of the file and
to the end of the file. This tag preserves whitespace and formatting in the HTML document. Your program should output the HTML file to disk.

As an example, given the following input file:

the program should produce a text file with the following contents:

You can test your output file by opening it with a web browser. The contents should appear identical to the original source code.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 12