Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 . Create a Baby class that stores the name, rank, and number of babies of that name from the CSV file. You are also
Create a Baby class that stores the name, rank, and number of babies of that name from the CSV
file. You are also required to create any necessary methods, constructors associated with this
Bab class.
For year using the data from the csv file, and create one array that stores all of the
baby boy names in it using the Baby class. For example,
BabyBoy new Baby;
Populate all of the baby boy information in the above array.
Sort the array in step alphabetically of their name, using the sort function associate with the
array in step You have to use the Comparable interface as described in chapter to
complete this step. Print out the array.
Repeat the above process for baby girls for That is populate and sort the girl baby array.
Print out the array.
Repeat the above steps for all years. That is you should be arrays of boys and arrays of
girls information, all sorted alphabetically. Print out the array.
Create a Total boy arraylist of Baby from the baby boys arrays that sums up all babies with
that name across years. This total array will not be only but will be more then
elements since there are more than names now. The arraylist need to be sorted by name
as well. Print out the array.
Repeat the same in step for girls. Print out the array.
Make sure that you protect your code from getting into FileNotFoundException.
Hint: when you print out the array, the format should look like this.
need to modify the toString method
For example: Baby Name: Rank : Number
Michael: :
java
Image provided is a snippet of one of the csv files to provide context on how it is formatted.
please answer as soon as possible
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started