From c2c4c870e373e55c405cbdcc7e903be84cb462f5 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 19 Jul 2017 14:38:58 +0000 Subject: [PATCH 1/3] james --- demo.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 demo.js diff --git a/demo.js b/demo.js new file mode 100644 index 0000000..c76eda6 --- /dev/null +++ b/demo.js @@ -0,0 +1,27 @@ +function getBMI(height,weight) { + return weight/Math.pow(height,2); +} +function getMessage(height, weight){ + var bmi = getBMI(height, weight); + console.log("bmi = " + bmi); + if(bmi < 18.5) { + console.log('體重過輕'); + } + else if(18.5 <= bmi && bmi < 24) { + console.log('正常範圍'); + } + else if(24<= bmi && bmi < 27) { + console.log('過重'); + } + else if(27<= bmi && bmi < 30) { + console.log('輕度肥胖'); + } + else if(30<= bmi && bmi < 35) { + console.log('中度肥胖'); + } + else if(35<= bmi) { + console.log('重度肥胖'); + } +} +//getBMI(1.55,52); +getMessage(1.55,52); \ No newline at end of file From 0fb5dfe086b2ebe1af3f8bb4fb39dfc69848bb19 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 19 Jul 2017 14:42:14 +0000 Subject: [PATCH 2/3] hw --- 2017-hellojs_overflow-james.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 2017-hellojs_overflow-james.js diff --git a/2017-hellojs_overflow-james.js b/2017-hellojs_overflow-james.js new file mode 100644 index 0000000..c76eda6 --- /dev/null +++ b/2017-hellojs_overflow-james.js @@ -0,0 +1,27 @@ +function getBMI(height,weight) { + return weight/Math.pow(height,2); +} +function getMessage(height, weight){ + var bmi = getBMI(height, weight); + console.log("bmi = " + bmi); + if(bmi < 18.5) { + console.log('體重過輕'); + } + else if(18.5 <= bmi && bmi < 24) { + console.log('正常範圍'); + } + else if(24<= bmi && bmi < 27) { + console.log('過重'); + } + else if(27<= bmi && bmi < 30) { + console.log('輕度肥胖'); + } + else if(30<= bmi && bmi < 35) { + console.log('中度肥胖'); + } + else if(35<= bmi) { + console.log('重度肥胖'); + } +} +//getBMI(1.55,52); +getMessage(1.55,52); \ No newline at end of file From 1e3cf316e76b7e3f94fb8289da99a889aeffd66d Mon Sep 17 00:00:00 2001 From: James Date: Wed, 19 Jul 2017 22:46:53 +0800 Subject: [PATCH 3/3] Delete demo.js --- demo.js | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 demo.js diff --git a/demo.js b/demo.js deleted file mode 100644 index c76eda6..0000000 --- a/demo.js +++ /dev/null @@ -1,27 +0,0 @@ -function getBMI(height,weight) { - return weight/Math.pow(height,2); -} -function getMessage(height, weight){ - var bmi = getBMI(height, weight); - console.log("bmi = " + bmi); - if(bmi < 18.5) { - console.log('體重過輕'); - } - else if(18.5 <= bmi && bmi < 24) { - console.log('正常範圍'); - } - else if(24<= bmi && bmi < 27) { - console.log('過重'); - } - else if(27<= bmi && bmi < 30) { - console.log('輕度肥胖'); - } - else if(30<= bmi && bmi < 35) { - console.log('中度肥胖'); - } - else if(35<= bmi) { - console.log('重度肥胖'); - } -} -//getBMI(1.55,52); -getMessage(1.55,52); \ No newline at end of file