Expert answer:please use Eclipse Jee Oxygen and can you combine all the code to wordTopic ass 6Primitive ArraysDescription Write a program that will compute a number of statistics for a set of data provided by the user. The data will be made up of decimal numbers. After inputting the data, the program will compute and display the following statistics relating to the data.Min ValueMax ValueMean ValueMedian ValueImplementationDo the above assignment by creating two classes: Statistics and TestStatistics. The class Statistics will be used as a blue print for a Statistics object.It will keep a set of data and will provide methods to compute statistics relating to the data. The data will be provided to the Statistics object in an array during object construction.The class TestStatistics will be used to hold the method main. The method main will be used to input the data, create the Statistics object, compute statistics by calling Statistics object methods and display the values received.Class StatisticsThe class Statistics will provide the following:A private array variable data for holding user data.A private array variable sdata for holding a sorted copy of the above data.A constructor to initialize the array data.A method getOrigData for returning a copy of the array data.A method getSortedData for returning a copy of the original array but now sorted.A method findMin for computing minA method findMax for computing maxA method findMean for computing mean (or average)A method findMedian for computing medianClass TestStatisticsThe class TestStatistics will provide the method main which will do the following:Prompt the user for the number of total items in the data.Create an array of that size.Input data items from the user and store them in the array.Create an object of the class Statistics and pass it the data array.Call a Statistics object method to obtain the original data array.Call a Statistics object method to obtain the data array but now sorted in ascending order.Call Statistics object methods for calculating the min, max, mean and median values.Display the original data, data sorted in ascending order, min, max, mean and median values.Testing Test Run: Input(User input is shown in bold).Enter the Number Of Data Values: 12Enter Data Value: 7.2Enter Data Value: 7.6Enter Data Value: 5.1Enter Data Value: 4.2Enter Data Value: 2.8Enter Data Value: 0.9Enter Data Value: 0.8Enter Data Value: 0.0Enter Data Value: 0.4Enter Data Value: 1.6Enter Data Value: 3.2Enter Data Value: 6.4Output Original Data:7.2 7.6 5.1 4.2 2.8 0.9 0.8 0.0 0.4 1.6 3.2 6.4Sorted Data: 0.0 0.4 0.8 0.9 1.6 2.8 3.2 4.2 5.1 6.4 7.2 7.6Min Value: 0.0Max Value: 7.6Mean: 3.35Median: 3.0DiscussionMeanMean refers to the average value of the data.MedianMedian is the middle number. It has as many numbers above it as below it.For example for odd count data: 2, 4, 6, 8 and 10, the number 6 is median. It has two numbers lower than it and two number higher than it.For even count data: 2, 4, 6, 7, 8 and10, there are two medians: the number 6 and 7. The median is the average of the two medians. So the median for this data is 6.5. Sample Code Calculating Median//sample code below computes the median//The code below assumes that sdata is an array that contains sorted data.public double findMedian ( ){ //Declare variables int index, indexHi, indexLo; double median; //Determine if the length is odd or even. if ( (sdata.length %2) != 0 ) { index = sdata.length / 2; median = sdata [index]; } else { indexHi = sdata.length / 2; indexLo = indexHi – 1; median = (sdata[indexLo] + sdata[indexHi] ) / 2; } return median;}Sorting//sample code below sorts an array data.//Using code below, you can sort an array of int or double.import java.util.*;Arrays.sort (data);Copying an Array You can copy an array, say source of type double or int, starting at its element 0, to another array, say dest of the same type and starting at its element 0 as below: (source.length is the length of the source array).System.arraycopy (source, 0, dest, 0, source.length );Receiving an Array Whenever you receive an array as a parameter, you are receiving a copy of a reference to it. If you want to save the contents of this array array, it’s good idea to create another array and copy the contents of the array received into that array.Also, the min, the max and median values of data contained in an array can be found easily by sorting the array.Below, the constructor Statistics receives an array d and copies its contents into two separate instant arrays data, sdata. It then sorts the array sdata. The array sdata can be later used for finding min, max and median values.private double [] data; //instance variableprivate double [] sdata; //instance variable//constructor Statisticspublic Statistics (double [ ] d ){ //create the array data, sdata data = new double [d.length]; sdata = new double [d.length]; //copy the data from array d into array data and sdata System.arraycopy (d, 0, data, 0, d.length); System.arraycopy (d, 0, sdata, 0, d.lenth); //sort the array sdata Arrays.sort (sdata ); //To access Arrays, import java.util.*:}Returning an Array When you return an array from a method, only a copy of the reference to the array is returned. Thus on return, the caller of the method will have access to the array returned. So the caller can modify the array. If you don’t want the caller to be able to modify the array being returned, copy the array into another array and return that array.Below, the method getSortedData ( ) below returns a copy of the array sdata. The array sdata is an instance array containing the sorted data. Its declaration is not shown.//the method below returns a copy of the instance array sdata containing the sorted data.public double [ ] getSortedData ( ){ //create a new array d. //array sdata is an instance variable not shown. double [ ] d = new double [ sdata.length ]; //copyt the array sdata into array d System.arraycopy ( sdata, 0, d, 0, sdata.length ); //return the reference of the array d retrun d;}Receiving an Array Returned When a method returns an array, it returns a copy of the reference to the array. So the caller should create a array reference variable to receive the array reference returned.Below, the caller receives an array reference by calling the method getSortedData ( ) shown earlier.//create an array referencedouble [ ] sortedData ;//Receive an array returned by method getSortedData ( )sortedData = getSortedData ( );Displaying Contents Of An ArrayBelow, the code displays the contents of an array sdata containing numbers. The contents of the original array can also be displayed in the same way. String out = “Sorted Data:n”;For (int i=0; i You will get a plagiarism-free paper and you can get an originality report upon request. All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades How it works
Will the writer plagiarize my essay?
Is this service safe?
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more