Question: JAVA consider this csv file Name, Alex, Bert, Carl, Dave, Elly, Fran, Gwen, Hank, Ivan, Jake, Kate, Luke, Myra, Neil, Omar, Page, Quin, Ruth, Sex,

JAVA

consider this csv file

"Name", "Alex", "Bert", "Carl", "Dave", "Elly", "Fran", "Gwen", "Hank", "Ivan", "Jake", "Kate", "Luke", "Myra", "Neil", "Omar", "Page", "Quin", "Ruth", "Sex", "Age", "Height (in)", "Weight (lbs)" "M", 41, 74, 170 "M", 42, 68, 166 "M", 32, 70, 155 "M", 39, 72, 167 "F", 30, 66, 124 "F", 33, 66, 115 "F", 26, 64, 121 "M", 30, 71, 158 "M", 53, 72, 175 "M", 32, 69, 143 "F", 47, 69, 139 "M", 34, 72, 163 "F", 23, 62, 98 "M", 36, 75, 160 "M", 38, 70, 145 "F", 31, 67, 135 "M", 29, 71, 176 "F", 28, 65, 131

a. Write a class PersonDataService that will perform some statistics / filtering on the persons data through the following methods: 1. int averageAge(List persons) Calculate the mean age of the persons list. 2. List filter(List persons, int thresholdAge) Returns the list of persons which are specifically above the given threshold age. 3. int calculateYearOfBirth(Person person) returns the birth year of the given person. b. Write a class named TestBLI1 with a test() method that will contain the following use cases : 1. Call to the averageAge function on the person list with output of the result in the console. 2. Call to the filter on the persons list with 32 as a threshold, with output of the list size in the console. 3. Call to the calculateYearOfBirth on the 1 st person in the list (Alex) with output of the result to the console. c. Invoke that test() method in the main method of your launcher class

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!