Talar97

Egzamin 3 termin - waga

Apr 17th, 2018
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. float[][] waga(float[][] info){
  2.         float[][] tab = info;
  3.         float BMI = 0;
  4.  
  5.         for(int i=0; i < info.length; i++){
  6.             BMI = tab[i][0]/(tab[i][1]*tab[i][1]);
  7.             tab[i][2] = BMI;
  8.             if(BMI < 18.5){tab[i][3] = -1; }
  9.             else if(BMI > 18.5 && BMI < 24.99) { tab[i][3] = 0; }
  10.             else if(BMI >= 25.0) { tab[i][3] = 1; }
  11.         }
  12.  
  13.         return tab;
  14.     }
Add Comment
Please, Sign In to add comment