diff --git a/2017-nutc-jason/demo.js b/2017-nutc-jason/demo.js new file mode 100644 index 0000000..9d62646 --- /dev/null +++ b/2017-nutc-jason/demo.js @@ -0,0 +1,21 @@ +//楊漢笙 +function getBMI(weight,height){ + var bmi=weight/((height/100)*(height/100)); + return bmi; +} + +function getMessage(weight,height){ + var bmi=getBMI(weight,height); + console.log("bmi:"+bmi); + if(bmi<18.5){ + console.log("過輕") + } + if(bmi>18.5&&bmi<24){ + console.log("正常") + } + if(bmi>24){ + console.log("過重") + } +} + +getMessage(60,184); \ No newline at end of file diff --git a/2017-nutc-jason/package.json b/2017-nutc-jason/package.json new file mode 100644 index 0000000..27e23a9 --- /dev/null +++ b/2017-nutc-jason/package.json @@ -0,0 +1,12 @@ +{ + "name": "2017-nutc-jason", + "version": "1.0.0", + "description": "", + "main": "demo.js", + "scripts": { + "start": "node demo.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +}