diff --git a/2017-deadlineclub-ji40709/demo.js b/2017-deadlineclub-ji40709/demo.js new file mode 100644 index 0000000..8e10d4d --- /dev/null +++ b/2017-deadlineclub-ji40709/demo.js @@ -0,0 +1,19 @@ +//趙子權 +function getBMI(height,weight){ + var BMI = weight/(height*height); + return BMI; +}; + +console.log(getBMI(1.7,65)); + +function getMessage(height,weight){ + var BMI = weight/(height*height); + if(BMI<18.5){console.log('體重過輕');} + if(BMI>=18.5 & BMI<24){console.log('BMI為正常範圍');} + if(BMI>=24 & BMI<27){console.log('過重');} + if(BMI>=27 & BMI<30){console.log('輕度肥胖');} + if(BMI>=30 & BMI<35){console.log('中度肥胖');} + if(BMI>=35){console.log('重度肥胖');} +} + +console.log(getMessage(1.7,65)); diff --git a/2017-deadlineclub-ji40709/package.json b/2017-deadlineclub-ji40709/package.json new file mode 100644 index 0000000..a6d395c --- /dev/null +++ b/2017-deadlineclub-ji40709/package.json @@ -0,0 +1,12 @@ +{ + "name": "package", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "node demo.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +}