Page 673 - Introduction to Programming with Java: A Problem Solving Approach
P. 673

                Exercises 639 • Yourprogramshouldberobust(thatis,handletheweirdcases).Inparticular,itshouldhandlethecase
where there’s only a title and no paragraphs at all.
family.txt (the input file):
Our Family
We are Stacy and John and we live in a camper
down 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): <html>
<head>
<title>Our Family</title>
</head>
<body>
<h1>Our Family</h1>
  <p>
Apago PDF Enhancer
We are Stacy and John and we live in a camper
down by the river.
</p>
<p>
We have a dog, Barkley.
Barkley is a good dog.
She sleeps a lot and digs up the grass.
We feed
</p>
<p>
We have
They're
We like
</p>
</body>
</html>
her twice a day.
two kids, Jordan and Caiden.
girls. They like to eat, cry, and play.
them a lot.
7. [after §15.6] Assume that each of the following two lines (records) consists of 9 viewable characters each. Assuming they are written to a text file by println statements by a Windows computer, show the bit pattern for this data in a file.
Nik: x88
Josh: x24
8. [after §15.6] In Windows the text new-line symbol is . In UNIX the text new-line symbol is .
  





















































   671   672   673   674   675