Skip to content

Commit 7bc25aa

Browse files
committed
completed 3-mandatory-implement
1 parent 95e7076 commit 7bc25aa

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

Sprint-2/3-mandatory-implement/1-bmi.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@
1616

1717
function calculateBMI(weight, height) {
1818
// return the BMI of someone based off their weight and height
19-
}
19+
console.log("weight", weight);
20+
console.log("height",height);
21+
22+
const heightSquared = (height * height).toFixed(2);
23+
console.log("heightSquared",heightSquared);
24+
const BMI = (weight / heightSquared).toFixed(2);
25+
console.log("BMI",BMI)
26+
return BMI;
27+
}
28+
console.log("calculateBMI",calculateBMI(70, 1.73))

Sprint-2/3-mandatory-implement/2-cases.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@
1414
// You will need to come up with an appropriate name for the function
1515
// Use the MDN string documentation to help you find a solution
1616
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
17+
18+
function makeUpperCaseSnakeCase(str){
19+
const result = str.split(" ").join("_").toUpperCase(); //take str, and turn it into an array and then turn it back into a string with underscores then upper case it.
20+
console.log("result",result);
21+
}
22+
23+
console.log(makeUpperCaseSnakeCase("hello there"));

Sprint-2/3-mandatory-implement/3-to-pounds.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@
44
// You will need to declare a function called toPounds with an appropriately named parameter.
55

66
// You should call this function a number of times to check it works for different inputs
7+
8+
let count = 0;
9+
10+
count = count + 1;
11+
12+
function toPounds(pennies) {
13+
let pounds = pennies / 100;
14+
return pounds;
15+
}
16+
17+
console.log(toPounds(50));
18+
console.log(toPounds(100));
19+
console.log(toPounds(150));
20+
console.log(toPounds(250));
21+
console.log(toPounds(350));

0 commit comments

Comments
 (0)