Question: Please help me solve the problem(JAVA) the popularity ranking of baby names from years 2001 to 2005 is downloaded from www.ssa.gov/oact/babynames and stored in files

Please help me solve the problem(JAVA)

the popularity ranking of baby names from years 2001 to 2005 is downloaded from www.ssa.gov/oact/babynames and stored in files named babynameranking2001.txt, babynameranking2002.txt, , babynameranking2005.txt. You can access these files by unzipping babynameraking.zip. Each file contains one thousand lines. Each line contains a ranking, a boys name, number for the boys name, a girls name, and number for the girls name. For example, the first two lines in the file babynameranking2001.txt are as follows:

1 Jacob 32,509 Emily 25,048 2 Michael 29,666 Madison 22,149

So, the boys name Jacob and girls name Emily are ranked #1 and the boys name Michael and girls name Madison are ranked #2. 32,509 boys are named Jacob and 25,048 girls are named Emily. Write a program that prompts the user to enter the year, gender, and followed by a name, and displays the ranking of the name for the year. Here is a sample run:

 Enter the year: 2003 Enter the gender: M Enter the name: Javier Javier is ranked #190 in year 2003 Enter the year: 2004 Enter the gender: F Enter the name: ABC The name ABC is not ranked in year 2004 

Hint: Create two two-dimensional arrays to store names: String[][] boyNames = new String[5][1000]; String[][] girlNames = new String[5][1000]; boyNames[0][0] is the name rank #1 for year 2001. boyNames[4][10] is the name rank #11 for year 2005. girlNames[3][8] is the name rank #9 for year 2004. girlNames[2][342] is the name rank #343 for year 2003.

And Write a program that prompts the user to enter one of the filenames described in the LAST Question and displays the names that are used for both genders in the file. 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 ... 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!