Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public double getBMI( String weightUnit, String HeightUnit, double h, double, w){
- double weight;
- if(weightUnit.equals("pound"){
- weight = w * poundConversion;
- }
- if(heightUnit.equals("foot") && (weightUnit.equals("pound") || weightUnit.equals("kilogram"))) {
- double height = h * footConversion;
- return weight / (height * height);
- }
- else if (heightUnit.equals("inch" && (weightUnit.equals("pound") || weightUnit.equals("kilogram"))){
- double height = h * inchConversion;
- return weight / (height * height);
- }
- return -1;
- }
Add Comment
Please, Sign In to add comment