Advertisement
Chiddix

BMI

Sep 12th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1.     /**
  2.      * Calculates the body mass index with the specified inividual's mass and height.
  3.      * @param mass The mass of the individual, in kilograms.
  4.      * @param height The height of the individual, in meters.
  5.      * @return The calculated body mass index.
  6.      */
  7.     public static final double calculateBMIMetric(final double mass, final double height) {
  8.         return (mass / (Math.pow(height, 2)));
  9.     }
  10.  
  11.     /**
  12.      * Calculates the body mass index with the specified inividual's mass and height.
  13.      * @param mass The mass of the individual, in pounds.
  14.      * @param height The height of the individual, in inches.
  15.      * @return The calculated body mass index.
  16.      */
  17.     public static final double calculateBMIImperial(final double mass, final double height) {
  18.         return (mass / (Math.pow(height, 2)) * 703.06957964);
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement