Problem

Write an HTML Validator program that reads files of HTML data and uses stacks and queues t...

Write an HTML Validator program that reads files of HTML data and uses stacks and queues to verify whether the tags in the file are properly matched. A tag consists of a named element between less-than, <, and greater-than, >, symbols. Many tags apply to a range of text, in which case a pair of tags is used: an opening tag indicating the start of the range and a closing tag with a slash indicating the end of the range. For example, you can make some text bold like this. Tags can be nested to combine effects, bold italic. Some tags, such as the br tag for inserting a line break or img for inserting an image, do not cover a range of text and are considered to be “self-closing.” Self-closing tags do not need a closing tag; for a line break, only a tag of
is needed. Some web developers write self-closing tags with an optional / before the <, such as .

The following HTML file has some errors: the tag is not closed; the </head> tag appears twice; an extraneous </br> tag appears; and the <body> tag is not properly closed.</p><p><pre><!DOCTYPE html><html> <!--This is a comment--> <head> <title>Turtles are cool </head> </head> <body> Turtles swim in the <a href="ocean.com">ocean</a>. </br> Some turtles are over 100 years old. Here is a picture of a turtle: <img width="" height="" src="turtle.jpg" /> </html></pre></p></div>

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 14
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT