Skip to content

Commit 4403ed4

Browse files
committed
Add formatTimeDisplay(), played computer to answer questions
1 parent 0b95d7a commit 4403ed4

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

Sprint-1/3-mandatory-interpret/3-to-pounds.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const pounds = paddedPenceNumberString.substring(
1010
0,
1111
paddedPenceNumberString.length - 2
1212
);
13-
13+
console.log(paddedPenceNumberString);
14+
console.log(pounds);
1415
const pence = paddedPenceNumberString
1516
.substring(paddedPenceNumberString.length - 2)
1617
.padEnd(2, "0");

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

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,22 @@ function formatTimeDisplay(seconds) {
2222

2323
// a) When formatTimeDisplay is called how many times will pad be called?
2424
// =============> write your answer here
25+
// 3 times
2526

2627
// Call formatTimeDisplay with an input of 61, now answer the following:
2728

2829
// b) What is the value assigned to num when pad is called for the first time?
2930
// =============> write your answer here
31+
// 0
3032

3133
// c) What is the return value of pad is called for the first time?
3234
// =============> write your answer here
35+
// 00
3336

3437
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
3538
// =============> write your answer here
39+
// The value assigned is "1" because remainingSeconds was calculated as 61 % 60, which equals 1, and that is passed into pad last.
3640

3741
// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
3842
// =============> write your answer here
43+
// The return value is "01" because pad always ensures te output is atleast 2 characters long, so 1 becomes "01".

0 commit comments

Comments
 (0)