返回列表 發帖

20121015

import java.util.Scanner;

class BMIManager
{
        private float mHeight;
        private float mWeight;
        private boolean mSex;
        private float mBMI;
        private String mSuggestion;
        BMIManager(float h,float w,boolean s)
        {
                this.mHeight = h;
                this.mWeight = w;
                this.mSex = s;
                this.mBMI = 0;
        }
        void setHeight(float h)
        {
                this.mHeight = h;
        }
       
        float getHeight()
        {
                return this.mHeight;
        }
       
        void setWeight(float w)
        {
                this.mWeight = w;
        }
       
        float getWeight()
        {
                return this.mWeight;
        }
       
        void setSex(boolean s)
        {
                this.mSex = s;
        }
       
        boolean getSex()
        {
                return this.mSex;
        }
       
        float calculateBMI()
        {
                if(this.mBMI == 0)
                {
                        float h = this.mHeight/100;
                        h = h * h;
                        this.mBMI = this.mWeight/h;
                }
                return this.mBMI;
        }
       
        String suggestion()
        {
           if(mBMI == 0)
                   calculateBMI();
          
           if(this.mBMI >= 35)
           {
                   mSuggestion = "重度肥胖";
           }
           else if(this.mBMI >= 30 && this.mBMI <35)
           {
                   mSuggestion = "中度肥胖";
           }
           else if(this.mBMI >= 27 && this.mBMI <30)
           {
                   mSuggestion = "輕度肥胖";
           }
           else if(this.mBMI >= 24 && this.mBMI <27)
           {
                   mSuggestion = "過重";
           }
           else if(this.mBMI >= 18.5 && this.mBMI <24)
           {
                   mSuggestion = "標準";
           }
           else if(this.mBMI < 18.5)
           {
                   mSuggestion = "過輕";
           }
           return mSuggestion;
        }
       
        public static void main(String[] args)
        {
                   Scanner scan = new Scanner(System.in);
                   String yourname;
                   float h;
                   float w;
                   boolean s;
                   System.out.println("請輸入您的大名 : ");
                   yourname = scan.next();
                   System.out.println("請輸入您的身高 : ");
                   h = Float.parseFloat(scan.next());
                   System.out.println("請輸入您的體重 : ");
                   w = Float.parseFloat(scan.next());
                   System.out.println("請輸入您是男生(1)/女生(0) :");
                   s = Integer.parseInt(scan.next())==1;
                   BMIManager myBMI = new BMIManager(h,w,s);
                   System.out.print(myBMI.calculateBMI()+"\n");
                   System.out.printf("%s",myBMI.suggestion());
                  
                   /*
                   System.out.println("您輸入的大名 :"+yourname);
                   System.out.println("您輸入的身高 :"+myBMI.mHeight);
                   System.out.println("您輸入的體重 :"+myBMI.getWeight());
                   System.out.println("您輸入您是:"+(myBMI.getSex()==true?"男生":"女生"));
                   */
                  
        }
       
}

  1. import java.util.Scanner;

  2. class ManSuggestion
  3. {
  4.          String suggestion(float mBMI)
  5.      {         
  6.                 String mSuggestion = "";
  7.                 if(mBMI >= 35)
  8.                 {
  9.                         mSuggestion = "重度肥胖,你是神豬嗎 ?";
  10.                 }
  11.                 else if(mBMI >= 30 && mBMI <35)
  12.                 {
  13.                         mSuggestion = "中度肥胖,恭喜你可以請人家幫忙綁鞋帶!";
  14.                 }
  15.                 else if(mBMI >= 27 && mBMI <30)
  16.                 {
  17.                         mSuggestion = "過重,低頭快看不到你的腳趾頭了!";
  18.                 }
  19.                 else if(mBMI >= 24 && mBMI <27)
  20.                 {
  21.                         mSuggestion = "稍重,恭喜你還可以蹲下去綁鞋帶!";
  22.                 }
  23.                 else if(mBMI >= 18.5 && mBMI <24)
  24.                 {
  25.                         mSuggestion = "標準,帥哥一枚保持下去!";
  26.                 }
  27.                 else if(mBMI < 18.5)
  28.                 {
  29.                         mSuggestion = "過輕!!,紙片人!";
  30.                 }
  31.                 return mSuggestion;
  32.      }

  33. }

  34. class WomanSuggestion
  35. {
  36.          String suggestion(float mBMI)
  37.      {         
  38.                 String mSuggestion = "";
  39.                 if(mBMI >= 35)
  40.                 {
  41.                         mSuggestion = "不要每年都咬橘子壓!";
  42.                 }
  43.                 else if(mBMI >= 30 && mBMI <35)
  44.                 {
  45.                         mSuggestion = "太豐腴了 , 擋住我的電視了!";
  46.                 }
  47.                 else if(mBMI >= 27 && mBMI <30)
  48.                 {
  49.                         mSuggestion = "有點豐腴喔 , 注意一下飲食喔!";
  50.                 }
  51.                 else if(mBMI >= 24 && mBMI <27)
  52.                 {
  53.                         mSuggestion = "體重有點重,少吃一點會更好喔!";
  54.                 }
  55.                 else if(mBMI >= 18.5 && mBMI <24)
  56.                 {
  57.                         mSuggestion = "標準喔,正妹一個喔!";
  58.                 }
  59.                 else if(mBMI < 18.5)
  60.                 {
  61.                         mSuggestion = "過輕,再多吃一點會更好喔!";
  62.                 }
  63.                 return mSuggestion;
  64.      }

  65. }

  66. public class BMIManager {
  67.     private float mHeight;   
  68.     private float mWeight;
  69.     private String mSex;
  70.     private float mBMI=0;
  71.     String msuggestion;
  72.    
  73.     void setHeight(float h)
  74.     {
  75.             this.mHeight = h;
  76.     }
  77.    
  78.     float getHeight()
  79.     {
  80.             return this.mHeight;
  81.     }
  82.    
  83.     void setWeight(float w)
  84.     {
  85.             this.mWeight = w;
  86.     }
  87.    
  88.     float getWeight()
  89.     {
  90.             return this.mWeight;
  91.     }

  92.     void setSex(String s)
  93.     {
  94.             this.mSex=s;                                      
  95.     }
  96.    
  97.     String getSex()
  98.     {
  99.            
  100.             if (mSex.equals("M"))
  101.                     mSex="男士";                   
  102.             else if(mSex.equals("F"))
  103.                 mSex="女士";
  104.             else
  105.                     mSex="無法判別";
  106.            
  107.             return this.mSex;           
  108.     }
  109.    
  110.   
  111.        
  112.         BMIManager(float h , float w , String s)
  113.         {
  114.                 this.mHeight=h;
  115.                 this.mWeight=w;
  116.                 this.mSex=s;               
  117.         }
  118.    
  119.         float calculateBMI()
  120.         {
  121.                 if (mBMI==0)
  122.                 {
  123.                   mBMI = (mWeight/((mHeight/100)*(mHeight/100)));
  124.                 }
  125.                 return mBMI;
  126.         }
  127.        
  128.         String suggestion()
  129.         {
  130.                   if(mBMI == 0)
  131.               calculateBMI();
  132.                                             
  133.                   if (mSex.equals("男士"))                  
  134.                           return (new ManSuggestion()).suggestion(mBMI);  
  135.               else
  136.                       return (new WomanSuggestion()).suggestion(mBMI);                     
  137.         }
  138.        
  139.        
  140.        
  141. }

  142. import java.util.Scanner;


  143. public class BMIManagerTest {

  144.        
  145.         public static void main(String[] args) {
  146.                
  147.                
  148.                       String name,sex;
  149.                       float hight;
  150.                       float weight;
  151.                      
  152.                       Scanner scan = new Scanner(System.in);

  153.                       System.out.print("請輸入您的姓名=");
  154.                       name=scan.next();

  155.                       System.out.print("請輸入你的身高(cm)=");
  156.                       hight=Float.parseFloat(scan.next());

  157.                       System.out.print("請輸入你的體重(kg)=");
  158.                       weight=Float.parseFloat(scan.next());
  159.                      
  160.                       System.out.print("請輸入你的性別 M or F =");
  161.                       sex=scan.next();

  162.                       BMIManager myBMI = new BMIManager (hight , weight , sex);                     
  163.                                                           
  164.               System.out.println("親愛的 "+name+" "+myBMI.getSex()+" ,您的BMI="+myBMI.calculateBMI());
  165.               System.out.println(myBMI.suggestion());   
  166.               
  167.               
  168.         }

  169. }

  170. 請輸入您的姓名=kkman
  171. 請輸入你的身高(cm)=170
  172. 請輸入你的體重(kg)=99
  173. 請輸入你的性別 M or F =M
  174. 親愛的 kkman 男士 ,您的BMI=34.256054
  175. 中度肥胖,恭喜你可以請人家幫忙綁鞋帶!
複製代碼

TOP

  1. import java.util.Scanner;


  2. public class MyBMI
  3. {
  4.         public static void main(String[] args)
  5.         {
  6.             Scanner scan = new Scanner(System.in);
  7.             String yourname;
  8.             float h;
  9.             float w;
  10.             boolean s;
  11.             System.out.println("請輸入您的大名 : ");
  12.             yourname = scan.next();
  13.             System.out.println("請輸入您的身高 : ");
  14.             h = Float.parseFloat(scan.next());
  15.             System.out.println("請輸入您的體重 : ");
  16.             w = Float.parseFloat(scan.next());
  17.             System.out.println("請輸入您是男生(1)/女生(0) :");
  18.             s = Integer.parseInt(scan.next())==1;
  19.             BMIManager myBMI = new BMIManager(h,w,s);
  20.             System.out.print(myBMI.calculateBMI()+"\n");
  21.             //System.out.printf("%s",myBMI.suggestion());
  22.             
  23.             System.out.print(yourname + myBMI.suggestion());
  24.             
  25.         }

  26. }
複製代碼
回復 4# 陳建志

TOP

  1. import java.util.Scanner;

  2. class Suggestion
  3. {
  4.         String suggestion_man(float mBMI)
  5.         {         
  6.                    String mSuggestion = "";
  7.                    if(mBMI >= 35)
  8.                    {
  9.                            mSuggestion = " 先生重度肥胖";
  10.                    }
  11.                    else if(mBMI >= 30 && mBMI <35)
  12.                    {
  13.                            mSuggestion = " 先生中度肥胖";
  14.                    }
  15.                    else if(mBMI >= 27 && mBMI <30)
  16.                    {
  17.                            mSuggestion = " 先生輕度肥胖";
  18.                    }
  19.                    else if(mBMI >= 24 && mBMI <27)
  20.                    {
  21.                            mSuggestion = " 先生過重";
  22.                    }
  23.                    else if(mBMI >= 18.5 && mBMI <24)
  24.                    {
  25.                            mSuggestion = " 先生標準";
  26.                    }
  27.                    else if(mBMI < 18.5)
  28.                    {
  29.                            mSuggestion = " 先生過輕";
  30.                    }
  31.                    return mSuggestion;
  32.         }
  33.         
  34.         String suggestion_woman(float mBMI)
  35.         {         
  36.                    String mSuggestion = "";
  37.                    if(mBMI >= 35)
  38.                    {
  39.                            mSuggestion = " 小姐重度肥胖";
  40.                    }
  41.                    else if(mBMI >= 30 && mBMI <35)
  42.                    {
  43.                            mSuggestion = " 小姐中度肥胖";
  44.                    }
  45.                    else if(mBMI >= 27 && mBMI <30)
  46.                    {
  47.                            mSuggestion = " 小姐輕度肥胖";
  48.                    }
  49.                    else if(mBMI >= 24 && mBMI <27)
  50.                    {
  51.                            mSuggestion = " 小姐過重";
  52.                    }
  53.                    else if(mBMI >= 18.5 && mBMI <24)
  54.                    {
  55.                            mSuggestion = " 小姐標準";
  56.                    }
  57.                    else if(mBMI < 18.5)
  58.                    {
  59.                            mSuggestion = " 小姐過輕";
  60.                    }
  61.                    return mSuggestion;
  62.         }
  63. }

  64. class BMIManager
  65. {
  66.         private float mHeight;
  67.         private float mWeight;
  68.         private boolean mSex;
  69.         private float mBMI;
  70.         private String mSuggestion;
  71.         
  72.         BMIManager(float h,float w,boolean s)
  73.         {
  74.                 this.mHeight = h;
  75.                 this.mWeight = w;
  76.                 this.mSex = s;
  77.                 this.mBMI = 0;
  78.         }
  79.         
  80.         void setHeight(float h)
  81.         {
  82.                 this.mHeight = h;
  83.         }
  84.         
  85.         float getHeight()
  86.         {
  87.                 return this.mHeight;
  88.         }
  89.         
  90.         void setWeight(float w)
  91.         {
  92.                 this.mWeight = w;
  93.         }
  94.         
  95.         float getWeight()
  96.         {
  97.                 return this.mWeight;
  98.         }
  99.         
  100.         void setSex(boolean s)
  101.         {
  102.                 this.mSex = s;
  103.         }
  104.         
  105.         boolean getSex()
  106.         {
  107.                 return this.mSex;
  108.         }
  109.         
  110.         float calculateBMI()
  111.         {
  112.                 if(this.mBMI == 0)
  113.                 {
  114.                         float h = this.mHeight/100;
  115.                         h = h * h;
  116.                         this.mBMI = this.mWeight/h;
  117.                 }
  118.                 return this.mBMI;
  119.         }
  120.         
  121.         String suggestion()
  122.         {
  123.                 if(mBMI == 0)
  124.                            calculateBMI();
  125.                
  126.                 //性別判斷布林比較               
  127.                 if (mSex == true)
  128.                 {
  129.                
  130.                     return (new Suggestion()).suggestion_man(mBMI);
  131.                 }
  132.                 else
  133.                 {
  134.                         return (new Suggestion()).suggestion_woman(mBMI);
  135.                 }
  136.         }

  137.         /*
  138.         public static void main(String[] args)
  139.         {
  140.                    Scanner scan = new Scanner(System.in);
  141.                    String yourname;
  142.                    float h;
  143.                    float w;
  144.                    boolean s;
  145.                    System.out.println("請輸入您的大名 : ");
  146.                    yourname = scan.next();
  147.                    System.out.println("請輸入您的身高 : ");
  148.                    h = Float.parseFloat(scan.next());
  149.                    System.out.println("請輸入您的體重 : ");
  150.                    w = Float.parseFloat(scan.next());
  151.                    System.out.println("請輸入您是男生(1)/女生(0) :");
  152.                    s = Integer.parseInt(scan.next())==1;
  153.                    BMIManager myBMI = new BMIManager(h,w,s);
  154.                    System.out.print(myBMI.calculateBMI()+"\n");
  155.                    System.out.printf("%s",myBMI.suggestion());
  156.                   

  157.                    System.out.println("您輸入的大名 :"+yourname);
  158.                    System.out.println("您輸入的身高 :"+myBMI.mHeight);
  159.                    System.out.println("您輸入的體重 :"+myBMI.getWeight());
  160.                    System.out.println("您輸入您是:"+(myBMI.getSex()==true?"男生":"女生"));

  161.                   
  162.         }
  163.         */
  164.         
  165. }
複製代碼

TOP

  1. class ManSuggestion
  2. {
  3.                
  4.         String mSuggestion;
  5.         String mSuggestion(float mBMI, String mName)
  6.         {       
  7.                 if(mBMI >= 35)
  8.                 {       
  9.                         this.mSuggestion = mName + " 先生" + " 你胖死啦!! BMI: " + mBMI;
  10.                 }
  11.        
  12.                 else if(mBMI >= 30 && mBMI < 35)
  13.                 {
  14.                         this.mSuggestion = mName + " 先生" + " 你胖過頭囉! BMI:" + mBMI;
  15.                 }
  16.                
  17.                 else if(mBMI >= 27 && mBMI < 30)
  18.                 {
  19.                         this.mSuggestion = mName + " 先生" + " 你太胖囉 ~BMI:" + mBMI;
  20.                 }
  21.                
  22.                 else if(mBMI >= 24 && mBMI < 27)
  23.                 {
  24.                         this.mSuggestion = mName + " 先生"  + " 你吃太多了唷 BMI:" + mBMI;
  25.                 }
  26.                
  27.                 else if(mBMI >= 18.5 && mBMI < 24)
  28.                 {
  29.                         this.mSuggestion = mName + " 先生"  + " 真的這麼標準嗎=.= BMI:" + mBMI;
  30.                 }
  31.                
  32.                 else if(mBMI < 18.5)
  33.                 {
  34.                         this.mSuggestion = mName + " 先生"  + " 你是沒在吃飯嗎?? BMI:" + mBMI;
  35.                 }
  36.                
  37.                 else
  38.                 {
  39.                         this.mSuggestion = "你確定??" + mBMI;
  40.                 }
  41.                
  42.                 return mSuggestion;
  43.                        
  44.         }

  45. }


  46. class WomanSuggestion
  47. {
  48.         String mSuggestion;
  49.         String mSuggestion(float mBMI, String mName)
  50.         {       
  51.                 if(mBMI >= 35)
  52.                 {       
  53.                         this.mSuggestion = mName + " 女士" + " 請注意健康! BMI: " + mBMI;
  54.                 }
  55.        
  56.                 else if(mBMI >= 30 && mBMI < 35)
  57.                 {
  58.                         this.mSuggestion = mName + " 女士" + " 該控制一下飲食作息囉 ... BMI:" + mBMI;
  59.                 }
  60.                
  61.                 else if(mBMI >= 27 && mBMI < 30)
  62.                 {
  63.                         this.mSuggestion = mName + " 女士" + " 瘦一點會更好唷~ BMI:" + mBMI;
  64.                 }
  65.                
  66.                 else if(mBMI >= 24 && mBMI < 27)
  67.                 {
  68.                         this.mSuggestion = mName + " 女士"  + " 還算標準啦^^ BMI:" + mBMI;
  69.                 }
  70.                
  71.                 else if(mBMI >= 18.5 && mBMI < 24)
  72.                 {
  73.                         this.mSuggestion = mName + " 女士"  + " 妳十分健康唷^^ BMI:" + mBMI;
  74.                 }
  75.                
  76.                 else if(mBMI < 18.5)
  77.                 {
  78.                         this.mSuggestion = mName + " 女士"  + " 該多一點飯啦~ BMI:" + mBMI;
  79.                 }
  80.                
  81.                 else
  82.                 {
  83.                         this.mSuggestion = "妳確定??" + mBMI;
  84.                 }
  85.                
  86.                 return mSuggestion;
  87.                        
  88.         }

  89. }


  90. public class BMIManager
  91. {
  92.         String mName;
  93.         float mHeight;
  94.         float mWeight;
  95.         boolean mSex;
  96.         float mBMI = 0;
  97.         String mSuggestion;
  98.        
  99.         BMIManager(String n, float h, float w, boolean s)                //建構子
  100.         {
  101.                 this.mName = n;
  102.                 this.mHeight = h;
  103.                 this.mWeight = w;
  104.                 this.mSex = s;
  105.         }
  106.        
  107.         void setName(String n)
  108.         {
  109.                 this.mName = n;
  110.         }
  111.        
  112.         void setHeight(float h)
  113.         {
  114.                 this.mHeight = h;
  115.         }
  116.        
  117.         void setWeight(float w)
  118.         {
  119.                 this.mHeight = w;
  120.         }
  121.        
  122.         void setSex(boolean s)
  123.         {
  124.                 this.mSex = s;
  125.         }
  126.        
  127.         float getHeight()
  128.         {
  129.                 return this.mHeight;
  130.         }
  131.        
  132.         float getWeight()
  133.         {
  134.                 return this.mWeight;
  135.         }
  136.        
  137.         boolean getSex()
  138.         {
  139.                 return this.mSex;
  140.         }
  141.        
  142.         float caculateBMI()
  143.         {
  144.                 float h;
  145.                 h = (this.mHeight/100)*(this.mHeight/100);
  146.                 this.mBMI = this.mWeight/h;
  147.                 return this.mBMI;
  148.         }
  149.        
  150.         String suggestion()
  151.     {
  152.                 if(mBMI==0)
  153.                         caculateBMI();
  154.                 if(mSex)
  155.                 {
  156.                         this.mSuggestion = (new ManSuggestion()).mSuggestion(mBMI, mName);
  157.                 }
  158.                 else
  159.                 {
  160.                         this.mSuggestion = (new WomanSuggestion()).mSuggestion(mBMI, mName);
  161.                 }
  162.                 return this.mSuggestion;
  163.     }
  164. }
複製代碼
  1. import java.util.Scanner;


  2. public class MyBMI
  3. {
  4.         public static void main(String[] args)
  5.         {
  6.                 Scanner scan = new Scanner(System.in);
  7.                 String name;
  8.                 float h;
  9.                 float w;
  10.                 boolean s;

  11.                 System.out.println("請輸入您的大名 : ");
  12.                 name = scan.next();
  13.                 System.out.println("請輸入您的身高(公分) : ");
  14.                 h = Float.parseFloat(scan.next());
  15.                 System.out.println("請輸入您的體重(公斤) : ");
  16.                 w = Float.parseFloat(scan.next());
  17.                 System.out.println("請輸入您的性別男1/女0 : ");
  18.                 s = Integer.parseInt(scan.next())==1;
  19.                
  20.                 BMIManager myBMI = new BMIManager(name, h, w, s);
  21.                
  22.                 myBMI.caculateBMI();
  23.                 System.out.println(myBMI.suggestion());
  24.         }

  25. }
複製代碼

TOP

  1. import java.util.Scanner;

  2. class Suggestion
  3. {
  4.         String suggestion(float mBMI)
  5.         {          
  6.                    String mSuggestion = "";
  7.                    if(mBMI >= 35)
  8.                    {
  9.                            mSuggestion = "重度肥胖";
  10.                    }
  11.                    else if(mBMI >= 30 && mBMI <35)
  12.                    {
  13.                            mSuggestion = "中度肥胖";
  14.                    }
  15.                    else if(mBMI >= 27 && mBMI <30)
  16.                    {
  17.                            mSuggestion = "輕度肥胖";
  18.                    }
  19.                    else if(mBMI >= 24 && mBMI <27)
  20.                    {
  21.                            mSuggestion = "過重";
  22.                    }
  23.                    else if(mBMI >= 18.5 && mBMI <24)
  24.                    {
  25.                            mSuggestion = "標準";
  26.                    }
  27.                    else if(mBMI < 18.5)
  28.                    {
  29.                            mSuggestion = "過輕";
  30.                    }
  31.                    return mSuggestion;
  32.         }
  33. }

  34. class BMIManager
  35. {
  36.         private float mHeight;
  37.         private float mWeight;
  38.         private boolean mSex;
  39.         private float mBMI;
  40.         private String mSuggestion;
  41.        
  42.         BMIManager(float h,float w,boolean s)
  43.         {
  44.                 this.mHeight = h;
  45.                 this.mWeight = w;
  46.                 this.mSex = s;
  47.                 this.mBMI = 0;
  48.         }
  49.        
  50.         void setHeight(float h)
  51.         {
  52.                 this.mHeight = h;
  53.         }
  54.        
  55.         float getHeight()
  56.         {
  57.                 return this.mHeight;
  58.         }
  59.        
  60.         void setWeight(float w)
  61.         {
  62.                 this.mWeight = w;
  63.         }
  64.        
  65.         float getWeight()
  66.         {
  67.                 return this.mWeight;
  68.         }
  69.        
  70.         void setSex(boolean s)
  71.         {
  72.                 this.mSex = s;
  73.         }
  74.        
  75.         boolean getSex()
  76.         {
  77.                 return this.mSex;
  78.         }
  79.        
  80.         float calculateBMI()
  81.         {
  82.                 if(this.mBMI == 0)
  83.                 {
  84.                         float h = this.mHeight/100;
  85.                         h = h * h;
  86.                         this.mBMI = this.mWeight/h;
  87.                 }
  88.                 return this.mBMI;
  89.         }
  90.        
  91.         String suggestion()
  92.         {
  93.                 if(mBMI == 0)
  94.                            calculateBMI();
  95.                 return (new Suggestion()).suggestion(mBMI);
  96.         }
  97.        
  98.         public static void main(String[] args)
  99.         {
  100.                    Scanner scan = new Scanner(System.in);
  101.                    String yourname;
  102.                    float h;
  103.                    float w;
  104.                    boolean s;
  105.                    System.out.println("請輸入您的大名 : ");
  106.                    yourname = scan.next();
  107.                    System.out.println("請輸入您的身高 : ");
  108.                    h = Float.parseFloat(scan.next());
  109.                    System.out.println("請輸入您的體重 : ");
  110.                    w = Float.parseFloat(scan.next());
  111.                    System.out.println("請輸入您是男生(1)/女生(0) :");
  112.                    s = Integer.parseInt(scan.next())==1;
  113.                    BMIManager myBMI = new BMIManager(h,w,s);
  114.                    System.out.print(myBMI.calculateBMI()+"\n");
  115.                    System.out.printf("%s",myBMI.suggestion());
  116.                   
  117.                    /*
  118.                    System.out.println("您輸入的大名 :"+yourname);
  119.                    System.out.println("您輸入的身高 :"+myBMI.mHeight);
  120.                    System.out.println("您輸入的體重 :"+myBMI.getWeight());
  121.                    System.out.println("您輸入您是:"+(myBMI.getSex()==true?"男生":"女生"));
  122.                    */
  123.                   
  124.         }
  125.        
  126. }
複製代碼

TOP

返回列表