







/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication36;
/**
*
* @author bach
*/
public interface Functions {
public double average(int[] arr,int size);
public double ComputeSTDev(int[] arr,int size,double mean);
}/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication36;
/**
*
* @author bach
*/
public class ComputeDev implements Functions {
public int[] array;
public ComputeDev(int N){
array=new int[N];
}
@Override
public double average(int[] arr, int size) {
double d=0;
for(int i=0;i<size;i++)
{
d=arr+d;
}
return (d/size);
}
@Override
public double ComputeSTDev(int[] arr, int size, double mean) {
double d=0;
for(int i=0;i<size;i++)
{
d=((arr-mean)*(arr-mean))+d;
}
return Math.sqrt((d/(mean-1)));
}
}هاته مجرد محاولة
حاول تعدل على الكود
بالتوفيق
تم تعديل هذه المشاركة بواسطة guendouzbachir في 2 يوليو 2012 في 17:02
Just Be Nice
الأخ الكريم/الأخت الكريمة
السلام عليكم ورحمة الله وبركاته.
مرحباً بكم في منتدى الفريق العربي للبرمجة
تأسف إدارة المنتدى لغلق الموضوع وذلك لمخالفته قوانين المشاركات، فقرة طلب حل الواجبات والتمارين.
قواعد طرح المشاركات
شاكرين لكم حُسن تعاونكم
هذا الموضوع مغلق.
المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية
جارٍ التحقق من المتواجدين…