658
2016-10-04 15:42:44
0
재미없는 과제네요..
과제니까 몇줄은 알아서 작성하셔야함
Scanner s= new Scanner(System.in);
double USL = 100.5;
double LSL = 99.5;
double allow = USL - LSL;
double average = 0;
double sigma = 0;
double sum = 0;
double result = 0;
String input;
ArrayList<Double> inputArray = new ArrayList<Double>();
System.out.println("측정값 입력(스페이스로 구분)");
input = s.nextLine();
for (String str : input.split(" ")) {
double temp = Double.parseDouble(str);
inputArray.add(temp);
sum += temp;
}
average = sum/inputArray.size();
for(double d : inputArray){
result += (d-average)*(d-average);
}
sigma = 0; //TODO 시그마 공식
result = 0; //TODO Cp 구하셈
System.out.println("평균: " + average);
System.out.println("sigma: " + sigma);
System.out.println("Cp: " + result + "n");
if(result < 1.00){
System.out.println("공정능력 저조");
}else if(result <= 1.33){
System.out.println("공정능력 보통");
}else{
System.out.println("공정능력 우수");
}