Hello, everyone. I'm at the moment doing a homework assignment involving static methods and arrays. It consists of the following instructions.
I'm to create a class known as ArrayStatisticsMethods and in this class, there are definitions to four different "public static" methods which will be described. I'm provided the use of a problem known as StatCalculator which will be provided as well for it isn't modified in any way. The parameters for the methods are arrays and we refer to the array as full if something is assigned to every index in the array. Java can allow arrays to be of size 0 and for what I've been asked, there is no meaningful output and I can assume that arrays are not empty.
The instructions are as follows.
1) Write a method that takes a full array of double as a parameter and I'm to refer to this method as arrayMean. What it should do is to return the mean of the numbers in the array.
2) Write a method that takes a full array of double as a parameter and for this one, I should refer to this as arraySD. The method of arraySD is to determine and return the standard deviation of numbers in the array.
3) Write a method that takes a full array of double as a parameter however the method here requires me to calculate and return how many numbers in the array are above average and for that, the method is called aboveAverage.
4) Write a method that will take two parameters and both of them are arrays of double for I will refer to them as One and Two. They don't have to be the same size but the method should calculate the standard deviation for each of the two arrays and then it should compare the results. If the standard deviation of array "One" is more, then it is returned under the Boolean value as true but if it isn't, it's false. This method is named firstBigger.
Here is what I have so far and at this point, I really don't know what to do. I'm trying my best to find out what the heck I should do and it's driving me nuts. I've taken Java before but not like this so it has been more than a year since I had Java classes.
public class ArrayStatisticsMethods
{
public static double arrayMean (double getMean)
{
return getMean;
}
public static double arraySD (double getSD)
{
return getSD;
}
public static double aboveAverage (int average)
{
return average;
}
public static double firstBigger(double[] One, double[] Two)
{
StatCalculator s = new StatCalculator();
for(int i = 0; i < One.length;i++)
{
s.putNumber(One[i]);
}
return s.getMean();
}
}
If anyone can help me, it would be greatly appreciative. I'll update if anything comes up.