/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hyl;

import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;

/**
 *
 * @author Administrator
 */
@WebService(serviceName = "WeightCheck")
public class WeightCheck {

    /**
     * Web 服务操作
     */
    @WebMethod(operationName = "check")
    public String check(@WebParam(name = "sex") boolean sex, @WebParam(name = "weight") int weight, @WebParam(name = "height") int height) {
        int r = height - weight;
        if (sex) {
            r = 105 - r;
        } else {
            r = 115 - r;
        }
        if (r < -10) {
            return "太瘦";
        }
        if (r < 0 && r > -10) {
            return "偏瘦";
        }
        if (r > 0 && r < 10) {
            return "超重";
        }
        if (r > 10 && r < 20) {
            return "肥胖";
        } else {
            return "严重肥胖";
        }


    }
}
