I cant seem to figure out how exactly to find the standard deviation using what i have. the thing that is confusing me is really the whole standard deviation equation and how to exactly put it into code.
import java. util.Scanner;
public class StandardDeviation
{
public static void main (String[] args)
{
int array;
float sum = 0;
float mean;
Scanner scan = new Scanner(System.in);
System.out.println("Enter wanted array length:");
array = scan.nextInt();
float[] numbers = new float[array];
System.out.println("The size of the array: " + numbers.length);
for (int index = 0; index < numbers.length; index++)
{
System.out.print("Enter number " + (index+1) + ": ");
numbers[index] = scan.nextFloat();
}
for (float i : numbers)
{
sum += i;
}
mean = sum/numbers.length;
System.out.println("The mean is: " + mean);
}
}