-
Notifications
You must be signed in to change notification settings - Fork 29
2017-Overdeadline-ostrich2821 js-homework #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function getBMI(height,weight){ | ||
var myBMI = weight / (height * height); | ||
|
||
return myBMI; | ||
} | ||
|
||
getBMI(1.5, 50); | ||
|
||
var BMI = getBMI(1.5, 50); | ||
|
||
function getMessage(){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 因為作業的題目是getMessage函式可以傳入height與weight,所以這邊建議把bmi放到函式內,並讓getMessage傳入height與weight兩個參數,然後在getMessage內呼叫getBMI,例如:
|
||
if ( BMI < 18.5 ){ | ||
console.log('體重過輕'); | ||
}else if(18.5 <= BMI && 24 > BMI){ | ||
console.log('正常範圍'); | ||
}else{ | ||
console.log('異常範圍'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 判斷完 |
||
} | ||
} | ||
|
||
getMessage(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 這邊再 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
記得
//你的大名
歐