<%@ page contentType="text/html;charset=euc-kr" %>
<%! //--- ! 는 선언부이다.

/*
Scripting Elements는 JSP Page에 직접 코드를 끼워 넣을 수 있게 합니다.
JSP Scripting Elements는 세가지 타입( Declaration, Expression, Scriptlet ) 로 나눌 수 있습니다.
*/

int mathPoint[] = {30,50,80,20};


public double getAverage(){
double sum = 0;
for( int i = 0; i < mathPoint.length;i++){
sum += mathPoint[i];
}

return sum/mathPoint.length;
}


public double getBunsan(){
double sum = 0;
double average = getAverage();

for( int i = 0 ; i < mathPoint.length; i++){
sum += Math.pow((mathPoint[i] - average),2);
}
return sum/mathPoint.length;
}

public double getPyosun(){

return Math.sqrt(getBunsan());
}



%>
<html>

<body>

Declaration & Expression<p>



해당 점수에 대한 결과

평균 : <%=getAverage() %><br>

분산: <%=getBunsan() %><br>

표준편차 : <%=getPyosun() %><br>

</body>
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2009/10/07 15:35 2009/10/07 15:35
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/4693

Trackback URL : http://tcbs17.cafe24.com/tc/trackback/4693

« Previous : 1 : ... 1751 : 1752 : 1753 : 1754 : 1755 : 1756 : 1757 : 1758 : 1759 : ... 6391 : Next »

블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2024/05   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Statistics Graph

Site Stats

Total hits:
196766
Today:
511
Yesterday:
673