Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
