calculate Min Weight for your body - Android java.lang

Android examples for java.lang:Math

Description

calculate Min Weight for your body

Demo Code

/*/*from w w w .  j ava2s .c o  m*/
 *  Copyright (C) 2015, Jhuster, All Rights Reserved
 *  Author:  Jhuster(lujun.hust@gmail.com)
 *  
 *  https://github.com/Jhuster/EWeightScale
 *  
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 */
//package com.java2s;
import java.text.DecimalFormat;

public class Main {
    public static double calculateMinWeight(double height) {
        DecimalFormat format = new DecimalFormat("0.0");
        double result = 18.5 * height * height / 10000;
        return Double.valueOf(format.format(result).toString());
    }
}

Related Tutorials