File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
Sprint-2/3-mandatory-implement Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1616
1717function calculateBMI ( weight , height ) {
1818 // return the BMI of someone based off their weight and height
19- }
19+ let bmi = weight / ( height * height ) ;
20+ return bmi . toFixed ( 1 ) ;
21+ }
22+ console . log ( calculateBMI ( 80 , 1.80 ) ) ; // should return 24.7
Original file line number Diff line number Diff line change 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 toUpperSnakeCase ( str ) {
19+ return str . toUpperCase ( ) . replaceAll ( " " , "_" ) ;
20+ }
21+ console . log ( toUpperSnakeCase ( "hello there" ) ) ; // should return "HELLO_THERE"
22+ console . log ( toUpperSnakeCase ( "lord of the rings" ) ) ; // should return "LORD_OF_THE_RINGS"
Original file line number Diff line number Diff line change 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+ function toPounds ( kilograms ) {
9+ return + ( kilograms * 2.20462 ) . toFixed ( 1 ) ;
10+ }
11+ console . log ( toPounds ( 1 ) ) ; // should return 2.2
12+ console . log ( toPounds ( 5 ) ) ; // should return 11
13+ console . log ( toPounds ( 10 ) ) ; // should return 22
You can’t perform that action at this time.
0 commit comments