Problem

As explained in the text, strict HTML standards require all p start tags () to have an acc...

As explained in the text, strict HTML standards require all p start tags (

) to have an accompanying p end tag (

). Edit the HTMLGenerator.java program given in the text so that p end tags (

) are inserted properly in the generated HTML file. The p end tags should be inserted at the bottom of each paragraph.

Note:

• In the family.txt file below, assume that there is a newline character at the end of each line.

• Do not allow a p end tag to be generated when there’s no accompanying p start tag (start and end tags must always be partnered).

• Your program should be robust (that is, handle the weird cases). In particular, it should handle the case where there’s only a title and no paragraphs at all.

family.txt (the input file):

Our FamilyWe are Stacy and John and we live in a camperdown by the river.We have a dog, Barkley.Barkley is a good dog.She sleeps a lot and digs up the grass.We feed her twice a day.We have two kids, Jordan and Caiden.They're girls. They like to eat, cry, and play.We like them a lot.

family.html (the output file):

Our Family

Our Family

We are Stacy and John and we live in a camperdown by the river.

We have a dog, Barkley.Barkley is a good dog.She sleeps a lot and digs up the grass.We feed her twice a day.

We have two kids, Jordan and Caiden.They're girls. They like to eat, cry, and play.We like them a lot.

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 15
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