Java Reference
In-Depth Information
F IGURE 21.9
The user selects a year and gender, enters a year, and clicks the Find Ranking button to display the ranking.
**21.12
( Name for both genders ) Write a program that prompts the user to enter one of
the filenames described in Programming Exercise 12.31 and displays the names
that are used for both genders in the file. Use sets to store names and find com-
mon names in two sets. Here is a sample run:
Enter a file name for baby name ranking: babynamesranking2001.txt
69 names used for both genders
They are Tyler Ryan Christian ...
**21.13
( Baby name popularity ranking ) Revise Programming Exercise 21.11 to prompt
the user to enter year, gender, and name and display the ranking for the name.
Prompt the user to enter another inquiry or exit the program. Here is a sample
run:
Enter the year: 2010
Enter the gender: M
Enter the name: Javier
Boy name Javier is ranked #190 in year 2010
Enter another inquiry? Y
Enter the year: 2001
Enter the gender: F
Enter the name: Emily
Girl name Emily is ranked #1 in year 2001
Enter another inquiry? N
**21.14
( Web crawler ) Rewrite Listing 12.18, WebCrawler.java, to improve the perfor-
mance by using appropriate new data structures for listOfPendingURLs and
listofTraversedURLs .
**21.15
( Addition quiz ) Rewrite Programming Exercise 11.16 to store the answers in a
set rather than a list.
 
 
Search WWH ::




Custom Search