Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a NetBeans Java project named P62_yourname. Write a program that prompts the user to enter a year in the range [2001, 2010], a gender

Create a NetBeans Java project named P62_yourname. Write a program that prompts the user to enter a year in the range [2001, 2010], a gender and a name, then displays the ranking of the name for the selected year and gender. Technical Requirements:

a) The data for this project is to be read from by the program directly from the following URLs (DONT store these files locally): http://www.cs.armstrong.edu/liang/data/babynamesranking2001.txt http://www.cs.armstrong.edu/liang/data/babynamesranking2002.txt http://www.cs.armstrong.edu/liang/data/babynamesranking2003.txt http://www.cs.armstrong.edu/liang/data/babynamesranking2004.txt http://www.cs.armstrong.edu/liang/data/babynamesranking2005.txt http://www.cs.armstrong.edu/liang/data/babynamesranking2006.txt http://www.cs.armstrong.edu/liang/data/babynamesranking2007.txt http://www.cs.armstrong.edu/liang/data/babynamesranking2008.txt http://www.cs.armstrong.edu/liang/data/babynamesranking2009.txt http://www.cs.armstrong.edu/liang/data/babynamesranking2010.txt

b) The data files consist of lines of data, each containing a ranking (an integer), a boy's name (a string), the number of boy's that were given that name (an integer), a girl's name (a string) and the number of girls that where given that name (an integer). Values are separated by spaces and/or tabs, which java.util.Scanner will use as separators by default..

Here is an example of the first 10 lines of one of the files (babynamesranking2002.txt):

1 Jacob 30541 Emily 24450 2 Michael 28220 Madison 21771 3 Joshua 25965 Hannah 18802 4 Matthew 25142 Emma 16520 5 Ethan 22099 Alexis 15629 6 Andrew 21996 Ashley 15335 7 Joseph 21872 Abigail 15292 8 Christopher 21665 Sarah 14741 9 Nicholas 21380 Samantha 14652 10 Daniel 21291 Olivia 14627

c) Using java.util.Scanner to read from a URL: Create a java.net.URL instance object with the URL string, then pass the return of the URL method openStream() to the constructor of Scanner. For example: try (java.util.Scanner input = new java.util.Scanner(new java.net.URL( "http://www.cs.armstrong.edu/liang/data/babynamesranking2010.txt" ).openStream())) {

d) The data is to be stored in two arrays of maps, one for boys names and one for girls names. Each array must have one element for each of the 10 years of data. Each element in the array is a map (a class from the Java API that implements interface Map) that stores key / value pairs, each pair consisting of a name and its ranking, with the name serving as the key.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

=+what kinds of policies and practices should be developed?

Answered: 1 week ago

Question

=+ Of the HR issues mentioned in the case,

Answered: 1 week ago