As explained in the text, strict HTML standards require all p start tags (
) to have an accompanying p end tag (
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.txtfile below, assume that there is a newline character at the end of each line.• Do not allow a
pend tag to be generated when there’s no accompanyingpstart 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.
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.