CS 121: Assignment 6

Internet Programming

Due: Monday, February 25, 10:00 am


1) (30%) Exercise P21.2 (page 912)

2) (40%) The following URL displays the results of a search for the word "computer" on the BSU Web server: http://google.bsu.edu/search?q=computer . Try this URL out by entering it into a Web browser and modifying the search term. Write a program that asks the user for a string, then searches the BSU Web site for this string, and prints out the first URL that is found. Hint: the first search result is contained in the first <a> tag after the word "seconds". <a> tags are used for links in HTML and have the syntax: <a href="URL">linktext</a>. The indexOf(String str, int fromIndex) method from class String will be helpful.

3) (30%) Exercise P21.6


Reminder: use proper documentation comments on all classes, methods, and fields.



CS 121