Question: 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
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:

Data from Programming Exercise 21.11
Use the data files from Programming Exercise 12.31 to write a program that enables the user to select a year, gender, and enter a name to display the ranking of the name for the selected year and gender, as shown in Figure 21.9. To achieve the best efficiency, create two arrays for boy’s names and girl’s names, respectively. Each array has 10 elements for 10 years. Each element is a map that stores a name and its ranking in a pair with the name as the key.

Enter the year: 2010 -ner Enter the gender: M uener Enter the name: Javier JErte Boy name Javier is ranked #190 in year 2010 Enter another inquiry? Y Priar Enter the year: 2001 -ener Enter the gender: F -eter Enter the name: Emily -imter Girl name Emily is ranked #1 in year 2001 Enter another inquiry? N Jter
Step by Step Solution
3.46 Rating (175 Votes )
There are 3 Steps involved in it
import javautil import javanet public class Exercise2113 private Map mapForBoy new HashMap10 private ... View full answer
Get step-by-step solutions from verified subject matter experts
