Skip to content

hellos #38

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions 2017-I.S.Trump-danielcw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function getBMI(height,weight){
return weight/(Math.pow(height,2))*10000
}
function getMessage(height,weight){
var out=getBMI(height,weight)
if(out>=35){
return ("重大肥胖")
}else if(out>=30){
return ("中度肥胖")

}else if(out>=27){
return ("輕度肥胖")

}else if(out>=24){
return ("過重")
}else if(out>=18,5){

return ("正常範圍")
}else{
return ("體重過輕")
}

return (out>=35?"重大肥胖":(out>=30)?"中度肥胖":(out>=27)?"輕度肥胖":(out>=24)?"過重":(out>=18.5)?"正常範圍":"體重過輕")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這行不會被執行

}
console.log(getBMI(175,72))

console.log(getMessage(175,60))