Question: package studentWork; import com.opencsv.bean.CsvToBeanBuilder; import java.io.FileNotFoundException; import java.io.FileReader; public class H4_Q1 { public static void main(String[] args) { //Part a //modify line of code below

 package studentWork; import com.opencsv.bean.CsvToBeanBuilder; import java.io.FileNotFoundException; import java.io.FileReader; public class H4_Q1

package studentWork; import com.opencsv.bean.CsvToBeanBuilder; import java.io.FileNotFoundException; import java.io.FileReader; public class H4_Q1 { public static void main(String[] args) { //Part a  //modify line of code below  int[] numbers; //Part b  double average = 0; double sum = 0; //Part c  int t; //holds value at index j when swapping occurs   //Part d  //Uncomment and add to the code below   /*  if((numbers.length % 2) == 0)  {  /umber of records is even  }  else {   }   */   } }

Question 1 In this question you will be asked to complete basic statistics on a specified array of integer values. A good reference for basic statistics formulas can be found at: http://integral-table.com/downloads/stats.pdf. a. In the class file H4_Q1, create an int array named numbers initialized with the following values: {2,6,9, 3, 12, 4, 14,4}. b. Add code to HA_Q1 that determines the sample mean of numbers and prints it to the screen with an appropriate label. c. Using the algorithm given below, write code in H4_Q1 to sort the array numbers in ascending order. Let n be the size of numbers. input: a non-sorted list of n numbers, Q1, Q2 ..., An output: a list with the same numbers, sorted in non-decreasing order for i: n to 1 for j: 1 to i - 1 if a; > a3+1 then { // swap a, with a;+1 ta; aj aj +1 +1 -t Figure 1: Sorting Algorithm d. In HAQI, write code to identify the median of the data in numbers Note that your code should work when the dataset contains an even or odd number of records. Write the result to the screen with an appropriate label

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!