diff --git a/index.html b/index.html index 975ef26..9ce1522 100644 --- a/index.html +++ b/index.html @@ -7,5 +7,7 @@

Section 2: JavaScript Language Basics

+ - \ No newline at end of file + + diff --git a/script.js b/script.js new file mode 100644 index 0000000..7dfa13b --- /dev/null +++ b/script.js @@ -0,0 +1,11 @@ +const markMass = 70; +const markHeight = 1.70; +const johnMass = 50; +const johnHeight = 1.90; +let isMarkHigherBMI = calculateBMI(markMass, markHeight) > calculateBMI(johnMass, johnHeight); + +function calculateBMI(mass, height) { + return mass / Math.pow(height, 2); +} + +console.log("Is Mark's BMI higher than John's ? " + isMarkHigherBMI);