/** * CS139 - Programming Fundamentals * Department of Computer Science * James Madison University * @version Spring 2016 */
The Social Security Administration tracks the popularity of baby names on an annual basis. The goal of today's lab is to use HashMaps to develop an application that will allow us to interact with this data set.
yob2014.txt
This file
contains baby name data for 2014. Each line contains a name, the sex,
and a count.Complete BabyNames.java so that the functionality of the methods matches the provided documentation comments.
HINT #1: Recall that strings have a split
method that can be used to convert a string into an array by splitting at a particular delimiter. For example: "Bob,M,23".split(",")
would return the array {"Bob", "M", "23"}
.
HINT #2: Recall that the Integer.parseInt
method can be used to convert from the string representation of an integer to an int
.
For example Integer.parseInt("56")
will evaluate to the
integer value 56.
$ java PrintPopularName 1000 Emma
Submit your completed BabyNames.java file through Web-CAT.