Skip to content

Commit 045a934

Browse files
committed
I have fixed the mistakes according to the feedabck.
1 parent 5abf1f5 commit 045a934

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// =============> write your prediction here
44
// The program will print 320 first.
5-
// Then it will " The result of mutiplying 10 and 32 is undefined".
5+
// Then it will " The result of mutiplying 10 and 32 is 320".
66

77

88
function multiply(a, b) {
@@ -23,4 +23,5 @@ console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
2323
function multiply(a,b){
2424
return a*b;
2525
}
26+
2627
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)} `);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@
1616
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
1717

1818
function convertToUpperSnakeCase(str) {
19-
return str.toUpperCase().trim().split("").join("_");
19+
return str.toUpperCase().trim().split(" ").join("_");
2020
}
21+
22+
console.log(convertToUpperSnakeCase("hello there")); // "HELLO_THERE"

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

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@
55

66
// You should call this function a number of times to check it works for different inputs
77

8-
function toPounds(kilograms) {
9-
const pounds = kilograms * 2.20462;
10-
return Number(pounds.toFixed(2));
11-
}
8+
const toPounds = (kg) => +(kg * 2.20462).toFixed(2);
9+
10+
const penceToPounds = (p) => ${(p / 100).toFixed(2)}`;
11+
const toUpperSnakeCase = (s) => s.toUpperCase().trim().split(" ").join("_");
12+
const multiply = (a, b) => a * b;
13+
14+
// Tests
15+
console.log(toPounds(10)); // 22.05
16+
17+
console.log(penceToPounds(150)); // "£1.50"
18+
19+
console.log(toUpperSnakeCase("hello there"));
20+
// "HELLO_THERE"
21+
console.log(multiply(10, 32)); // 320
22+
23+
const convertToUpperSnakeCase = (str) =>
24+
str.toUpperCase().trim().split(" ").join("_");
25+
26+
console.log(convertToUpperSnakeCase("hello there")); // "HELLO_THERE"

Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ function assertEquals(actualOutput, targetOutput) {
3030
// What combinations of numerators and denominators should you test?
3131

3232
// Example: 1/2 is a proper fraction
33-
assertEquals(isProperFraction(1, 2), true);
33+
assertEquals(isProperFraction(1, 2), true);

0 commit comments

Comments
 (0)