Skip to content

Commit c38076f

Browse files
committed
hopefully the last leg
1 parent ed4e7a2 commit c38076f

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎Sprint-3/1-key-errors/0.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
// call the function capitalise with a string input
55
// interpret the error message and figure out why an error is occurring.
66

7-
function capitalise(str) {
7+
/*function capitalise(str) {
88
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
99
return str;
1010
}
11-
console.log(capitalise("beautiful"));
11+
console.log(capitalise("beautiful"));*/
1212

1313
// write your explanation here:
1414
// Syntax Error: Identifier 'Str' has been already been declared/assigned

‎Sprint-3/1-key-errors/1.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
// Try playing computer with the example to work out what is going on
88

9-
function convertToPercentage(decimalNumber) {
9+
/*function convertToPercentage(decimalNumber) {
1010
const decimalNumber = 0.5;
1111
const percentage = `${decimalNumber * 100}%`;
1212
1313
return percentage;
1414
}
1515
16-
console.log(decimalNumber);
16+
console.log(decimalNumber);*/
1717

1818
//=============> write your explanation here
1919
//The decimalNumber is declared twice as a result, calling convertToPercentage function and passing a value gets assigned to parameter decimalNumber
@@ -29,4 +29,4 @@ function convertToPercentage(decimalNumber) {
2929
}
3030
const decimalNumber = 0.5;
3131

32-
console.log(decimalNumber);
32+
console.log(convertToPercentage(0.5));

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@
1414
// Then when we call this function with the weight and height
1515
// It should return a string of their Body Mass Index to 1 decimal place
1616

17-
function calculateBMI(weight, height) {
17+
/*function calculateBMI(weight, height) {
1818
// return the BMI of someone based off their weight and height
19-
}
19+
}*/
2020

2121
function calculateBMI(weight, height) {
2222
//return (weight / height).toFixed(1); - 1st attempt
2323
//return (weight / (height * height)).toString().slice(0, 4); - 2nd attempt
24-
return "${(weight / (height * height)).toFixed(1)}";
24+
return (weight / (height * height)).toFixed(1);
2525
}
2626

27-
console.log(`the bmi of 70 and 2.99 is ${calculateBMI(70, 2.99)}`);
28-
console.log(`the bmi of 90 and 1.96 is ${calculateBMI(90, 1.96)}`);
27+
//console.log(`the bmi of 70 and 2.99 is ${calculateBMI(70, 2.99)}`);
28+
//console.log(`the bmi of 90 and 1.96 is ${calculateBMI(90, 1.96)}`);
29+
console.log(`The BMI is ${calculateBMI(70,1.73)} `);

‎Sprint-3/4-mandatory-interpret/time-format.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ function formatTimeDisplay(seconds) {
4040

4141
// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
4242
// =============> write your answer here
43-
// The answer is 01 because of the final output for formatTimeDisplay(61) is 00:01:01. The assigned value of 1 with the length of 1, the numString = "0" + numString becomes 1
43+
// The answer is 01 because of the final output for formatTimeDisplay(61) is 00:01:01. The assigned value of 1 with the length of 1, the numString = "0" + numString becomes 01

0 commit comments

Comments
 (0)