Skip to content

Commit d60ad83

Browse files
committed
fixes.
1 parent 5feaf2e commit d60ad83

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

Sprint-2/1-key-errors/0.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// =============> write your new code here
2020

2121
function capitalise(str) {
22-
let capitalisedStr = `${str[0].toUpperCase()}${str.slice(1)}`;
22+
const capitalisedStr = `${str[0].toUpperCase()}${str.slice(1)}`;
2323
return capitalisedStr;
2424
}
2525

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ function sum(a, b)
1717
return a + b;
1818
}
1919

20-
console.log(`The sum of 45 and 12 is ${sum(45, 12)}`); // Output: "The sum of 10 and 32 is 42"
20+
console.log(`The sum of 45 and 12 is ${sum(45, 12)}`); // Output: "The sum of 45 and 12 is 57"

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ const pounds = paddedPenceNumber.substring(
2222
const pence = paddedPenceNumber
2323
.substring(paddedPenceNumber.length - 2);
2424

25-
return `${pounds}.${pence}`;
25+
26+
const formattedPounds = pounds || "0";
27+
28+
return ${formattedPounds}.${pence}`;
2629
}
2730

2831
console.log(`The amount in pounds is ${toPounds("10000000")}`);

Sprint-2/4-mandatory-interpret/time-format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ console.log(formatTimeDisplay(61));
2929
// =============> would be 00.
3030

3131
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
32-
// =============> write your answer here
32+
// =============> The value assigned to num when pad is called for the last time is 1. This is because the last call to pad is for remainingSeconds, and remainingSeconds = 61 % 60 = 1.
3333

3434
// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
3535
// =============> It would be 01 because the last call to pad is for remainingSeconds which is 01 when seconds is 61.

0 commit comments

Comments
 (0)