Skip to content

Commit 0ff2089

Browse files
author
Arthur
committed
sprint 2 revision
1 parent 430f087 commit 0ff2089

5 files changed

Lines changed: 14 additions & 19 deletions

File tree

Sprint-2/2-mandatory-debug/0.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Instead, we should define the expression a * b
1414
and return the expression.
1515

1616
/ function multiply(a, b) {
17-
return (a * b);
17+
return a * b;
1818
}
1919

2020
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);

Sprint-2/2-mandatory-debug/1.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
Unexpected identifier "problem"
22
variable hasn't been defined so the variable cannot do function.
33

4-
function sum(a, b) {
5-
return;
6-
a + b;
7-
}
8-
9-
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
10-
114

125
because return should be followed by a + b;
136
the final result doesn't return the value.
147

158

169
function sum(a, b) {
17-
return;
18-
a + b;
10+
return a + b;
1911
}
2012

2113
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11

2-
3-
42
function calculateBMI(weight, height) {
53

64
let newheight = height / 100;
75
let num = weight / (newheight ** 2);
8-
let idea = num.toFixed(1);
6+
let result = num.toFixed(1);
97

10-
return idea;
8+
return result;
119
}
1210

1311

@@ -18,3 +16,4 @@ console.log(calculateBMI(58, 178));
1816

1917

2018

19+

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55

66
// Implement a function that:
77
function convertToUpperCase(text) {
8-
const result = text.toUpperCase();
9-
return result;
8+
9+
const result = text.split(' ').join("_");
10+
11+
return result.toUpperCase();
1012
}
1113

12-
console.log(convertToUpperCase("hello"));
14+
15+
16+
console.log(convertToUpperCase("hello there"));
1317

1418

1519

Sprint-2/5-stretch-extend/format-time.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ function formatAs12HourClock(time) {
1313
return `${paddedHour}:${minutes} pm`;
1414
}
1515

16-
else if(hours=== 0o0){
16+
else if(hours=== 0){
1717
const newHour= hours+ 12;
1818
return `${newHour}:${minutes} am`;}
1919

2020
else if(hours=== 12){
21-
return `12:00 pm`;
21+
return `12:${minutes} pm`;
2222

2323
}
2424

0 commit comments

Comments
 (0)