Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1.  
  2. public class negerino {
  3.    
  4.     private Double TreFloatMedel(Double[] floatArray) {
  5.         Double totalt = 0.0;
  6.         for (int i=0; i<floatArray.length; i++) {
  7.             totalt += floatArray[i];
  8.         }
  9.         return totalt/floatArray.length;
  10.     }
  11.  
  12.     public static void main(String[] args) {
  13.         Double[] leFloatz = {5.0, 3.0, 2.0};
  14.         negerino neger = new negerino();
  15.         Double r = neger.TreFloatMedel(leFloatz);
  16.         System.out.println(r.toString());
  17.     }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement