public class Arvutused{ public static double summa(double[] m){ double abi=0; for(double arv: m){ abi+=arv; //Liidab abile arvu juurde } return abi; } public static double keskmine(double[] m){ return summa(m)/m.length; } public static double keskmine(double arv1, double arv2){ return (arv1+arv2)/2; } public static void main(String[] a){ double[] arvud={2, 4, 5}; System.out.println(keskmine(3, 4)); System.out.println(summa(arvud)); System.out.println(keskmine(arvud)); } }