Create a method writeNewsPage in the class WebPageWriter that will create a page of the information you find important from at least 3 websites. See the Headline Grabber class and method writeHomepageV8 in the WebPageWriter class in the directory bookClassesFinal.

What will be an ideal response?


```
/? ?
? Method f o r w r i t i n g a homepage f o r t h e p a s s e d
? name w i t h t h e t o p 3 h e a d l i n e s from cnn , time , and p e o p l e
? @param name t h e p e r s o n ’ s name
? @param i n t e r e s t s a l i s t o f t h e p e r s o n ’ s i n t e r e s t s
?/
public void writeHomepageV8 ( S t r i n g name , S t r i n g i n t e r e s t s )
{
// t r y t h e f o l l o w i n g
try {
// open a f i l e f o r w r i t i n g
S t r i n g path = F i l e C h o o s e r . getMediaPath ( name + ” . html ” ) ;
BufferedWriter writer =
new B u f f e r e d W r i t e r (new F i l e W r i t e r ( path ) ) ;
// w r i t e t h e s t a r t
writeStart ( writer );
// w r i t e t h e h e a d e r
writeHead ( w r i t e r , name + ” ’ s Homepage” ) ;
// add t h e h e a d l i n e s
H e a d l i n e G r a b b e r g r a b b e r = new H e a d l in e G r a b b e r ( ) ;
S t r i n g body = ”

Welcome t o ” + name +
” ’ s Homepage

” +

I am i n t e r e s t e d i n ” + i n t e r e s t s ;
body = body + ”

The Top H e a d l i n e s from CNN, Time , and People

”+
g r a b b e r . getCNNHeadline ( ) + ”

” + g r a b b e r . g e t T i m e H e a d l i n e ( ) + ”

” +
grabber . getPeopleHeadline ( ) ;
// w r i t e t h e body
writeBody ( w r i t e r , body ) ;
// end t h e page
writeEnd ( w r i t e r ) ;
// c l o s e t h e w r i t e r
writer . close ( ) ;
} catch ( E x c e p t i o n ex ) {
ex . p r i n t S t a c k T r a c e ( ) ;
}
}
```

Computer Science & Information Technology

You might also like to view...

Which of the following is true?

A) Both the Set and List interfaces extend the Collection interface B) Both the Set and Map interfaces extend the Collection interface C) Both the List and Map interfaces extend the Collection interface D) None of the above

Computer Science & Information Technology

Case-Based Critical Thinking QuestionsCase 3-1Chris has inherited the management of some highly disorganized projects from her predecessor. One of its hallmarks is that the projects included a lot of constraints that have proven unnecessary, and which have complicated the reporting on the projects and the accurate assessment of where things stand. Because you were privy to a lot of the background about the projects, Chris has asked you to help her sort it all out.Chris knows that one of the projects was set to finish on April 29, 2009, no questions asked. Which constraint would she expect to find in place?

A. Finish No Later Than B. As Soon As Possible C. Must Finish On D. Must Start On

Computer Science & Information Technology

The ____________________ function can be used to determine if a variable contains values.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which of the following describes the primary reason the InfoSec department should NOT fall under the IT function?

A. The average salary of the top security executive typically exceeds that of the typical IT executive, creating professional rivalries between the two. B. There is a misalignment between the goals of the InfoSec department, which focuses on protecting information, and the IT function, which focuses on efficiency in processing and accessing information. C. There is a fundamental difference in the mission of the InfoSec department, which seeks to minimize access to information, and the IT function, which seeks to increase accessibility of information. D. None of the above are reasons the InfoSec department should NOT fall under the IT function.

Computer Science & Information Technology