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
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