Question: Java help NameRecord encapsulates the data for one name: the String name and its rank over the years. Use an int array to store the

Java help

Java help NameRecord encapsulates the data for one name: the String name

NameRecord encapsulates the data for one name: the String name and its rank over the years. Use an int array to store the int rank numbers. The NameRecord constants START-1880 and END-2016 define the start and end years in the data. Methods: o Constructor-takes a String name and sets up the NameRecord object. o String getName0-returns the name o void setRank (int year, int rank) - sets the rank of the name in the given year. Use the convention that year-0 is 1880, year-l is 1881, and so on. int getRank(int year)- returns the rank of the name in the given year. Use the convention that year-0 is 1880, year-1 is 1881, and so on. o o int bestYearO returns the year where the name was most popular, using the earliest year in the event of a tie. Returns the actual year, for example 1920, so the caller does not need to adjust for START. It is safe to assume that every name has at least one year with a non-zero rank

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!