-3
这是我到目前为止。我需要使用文本文件中的数字。如何计算人口标准差?
计算类:
public class Calculations {
public void readFile(String fileName, double[] myArray) throws Exception {
FileReader fr = null;
BufferedReader br;
}
public double computeStandardDeviation(double[] myArray) {
double result = 0;
return result;
}
}
主要类:
public class Main {
private static int NUMBERS=20;
public static void main(String[] args) {
double[] myNumbers = new double[NUMBERS];
Calculations calculations = new Calculations();
try {
calculations.readFile("numbers.txt", myNumbers);
double stdDev = calculations.computeStandardDeviation(myNumbers);
System.out.println("Population Std Dev = " + stdDev);
} catch (Exception e) {
e.printStackTrace();
}
}
}
欢迎来到堆栈溢出,请查看[我如何问一个好问题?](http://stackoverflow.com/help/how-to-ask) –