Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago