# BMI計算器 ## 需求擷取 我要一個App可以計算我的BMI是多少,最好可以順便告訴我適合的體重,如果可以順便量體重就更好了 ## 需求分析 1.計算BMI 2.適合體重 3.量體重(應刪除)  ## Use cases 使用案例 ```plantuml @startuml :User: --> (輸入身高體重) :User: --> (測量BMI) :app: --> (測試和體重) :app: --> (計算BMI) @enduml ``` ## User Stories 使用者故事 奕安是一名學生體重60kg,身高174cm。他想要測BMI。並且想要知道適合的體重是多少 小美是一名模特兒體重50kg,身高180cm。他想要測BMI。並且想要知道適合的體重是多少 館長是一名健身教練體重90kg,身高186cm。他想要測BMI。並且想要知道適合的體重是多少 | 測資 | 輸入 | 輸出 | | -------- | -------- | -------- | | 測資1 | 身高174 體重60 | BMi=19.82 , 適合體重=56.01~72.66 | | 測資2 | 身高180 體重50 | BMi=15.43 , 適合體重=59.94~77.76 | | 測資3 | 身高186 體重90 | BMi=26.01 , 適合體重=64.00~83.03 | ## 流程圖 ```flow st=>start: start e=>end: End op=>operation: 輸入BMI op2=>operation: 計算BMI cond=>condition: BMI<18.5 cond2=>condition: BMI<24 light=>end: 過輕 nomal=>end: 適中 heavy=>end: 過重 st->op->op2->cond->cond2 cond(yes)->light cond(no)->cond2 cond2(yes)->nomal cond2(no)->heavy ``` ## UI 使用者介面  ## 元件說明 水平配置:讓畫面能更美觀 輸入框:身高輸入 輸入框:體重輸入 標籤:顯示BMI,且設置為不可見 按鈕:計算BMI,並將數值顯示出來 min:體重最小值 max:體重最大值 ## 程式截圖      ## 結論及心得 透由這次的課程,讓我了解到更多關於程式的寫法,也有了更多的概念來處理問題,像是使用副函式來縮短主程式,或避免輸入框無輸入便按下計算所產生錯誤提示的bug
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.