佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 630|回复: 0

java program

[复制链接]
发表于 23-3-2007 08:56 PM | 显示全部楼层 |阅读模式
package Assignment;
import java.io.*;
import java.lang.Math;
public class TestRun1 {
public static void main (String[]args) throws IOException {
InputStreamReader reader = new InputStreamReader (System.in);
BufferedReader input = new BufferedReader(reader);
String text;
int n;
double xxx;
System.out.println("Enter the sample saiz");
text = input.readLine();
n =Integer.parseInt(text);
double [] xx = new double[n];
Double x;
for (int i=0; i<n; i++)
{
System.out.print("Input x["+i+"] = ");
text = input.readLine();
x=new Double(text);
xx = x.doubleValue();
System.out.println("x["+i+"] = "+xx);
}
System.out.println("Enter the mean population");
text = input.readLine();
x =new Double(text);
xxx = x.doubleValue();

double vn, sumx, sumxsq,stddev, xbar;
sumx =0;
sumxsq=0;
vn=n;

for(int i=0;i<xx.length; i++)
{
sumx = sumx + xx;
sumxsq = sumxsq + Math.pow(xx,2);
}
xbar = sumx/vn;
stddev=Math.sqrt((sumxsq-vn*xbar*xbar)/(vn-1.0));
System.out.println("sum x = " +sumx);
System.out.println("Stddev = " +stddev) ;


try {System.in.read();}
catch (Exception e) {}
  }

}

上面是我做到一半的program
请问谁会做接下来的java program
题目如下:
Hypothesis testing
In the java program, u should able to
a)      read sample size and data from keyboard
b)      read mean population from keyboard
c)      read the level of significant from keyboard
d)      perform 1 or 2 tailed tests
e)      select in between normal or t-distribution
f)        calculate the test statistic and p-value
g)      test the hypothesis whether to reject or do not reject H&#9702; at the significant level and print the result onto the screen
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 6-6-2024 03:22 PM , Processed in 0.074266 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表