阅读背景:

创建多个如果转换高度的语句

来源:互联网 
  public String convertHeightToFeetInches()
  {
    int leftOver = heightInInches % IN_PER_FOOT;

    if(heightInInches < (IN_PER_FOOT * 2)){
        return "1 foot " + leftOver + " inches";
    }
    else{ return "";
    }

    if(heightInInches < (IN_PER_FOOT * 3) && heightInInches > (heightInInches * 2)){
        return "2 foot " + leftOver + " inches";
    }
    else{
        return "";
}
  public String convertHeightToFeetInches()
  {



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: