Question: Hello, Please help in Java. Use ArrayLists, no bufferedReader. You have a file with multiple results from a local survey. Supposed you already wrote two

Hello, Please help in Java.

Use ArrayLists, no bufferedReader.

You have a file with multiple results from a local survey. Supposed you already wrote two classes:

-SurveyData class with fields: String name, String occupation, String location, int age, double score

-SurveyStats class with fields: int count, int day, int[] years

Created ArrayLists for both classes

//TODO - write a method using binary search for ArrayList that takes name, occupation and city from SurveyData class and returns statistics list using the SurveyStats class. Use an additional ArrayList, do a backward search to return the first occurence of data. Return null if not found. Incorporate this sample code for binary search but modify to match the given method start.

public SurveyStats getStats(String name, String location, String occupation)

Hello, Please help in Java. Use ArrayLists, no bufferedReader. You have a

- write a method that takes an array of the readings from SurveyData class and returns the slope of best fit line. Use x for age and y for score.

public double calcSlope(Readings[] surveyReadings)

public static int binarysearch(int [] a, int target) \{ int min =0; int max = a.length 1; while (min target) \{ max =mid1; else \{ return mid

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!