Please follow the steps attached to the file to write the code please.thanks
The code should follow this steps
Create a class that has private fields for
–Year (int)
–Population (long)
–Murder Rate (double)
–Robbery Rate (double)
Create a second class
•Field that is an array of CrimeData objects
(Constructor)
•Only argument is data file name
•Creates a new CrimeData object
•Inputs string from file
•Splits on comma
•Uses Wrapper class parse methods to
assign correct split elements to CrimeData
•Adds object to array
(Constructor)
•Need to read and ignore first line in file
–Has header information
–Not needed by program
•Use a while loop that goes to the end of the data file
–hasNext() method
(Methods in class with array)
•Find year of maximum murder rate
–For loop that looks for array element with
highest murder rate
–Returns Year field in that object
–DO NOT OUTPUT year in method
•Similar for minimum murder rate,
maximum robbery rate, and
minimum robbery rate
Final Project
(Methods in class with array)
•Method that calculates each year to year
population growth rate
•Beware of integer division problems
•May need a cast operator