Skip to content

Commit d687a21

Browse files
committed
Merge branch 'Sprint-2/4-mandatory-interpret' into Sprint-2/1-key-errors
2 parents 99dee79 + 9a48031 commit d687a21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,23 @@ function formatTimeDisplay(seconds) {
1818

1919
// a) When formatTimeDisplay is called how many times will pad be called?
2020
// =============> write your answer here
21+
// pad will be called 3 times, once for each of totalHours, remainingMinutes, and remainingSeconds.
2122

2223
// Call formatTimeDisplay with an input of 61, now answer the following:
24+
console.log(formatTimeDisplay(61));
2325

2426
// b) What is the value assigned to num when pad is called for the first time?
2527
// =============> write your answer here
28+
// The value assigned to num when pad is called for the first time is 0, which is the value of totalHours.
2629

2730
// c) What is the return value of pad is called for the first time?
2831
// =============> write your answer here
32+
// The return value of pad when called for the first time is "00", which is the string representation of totalHours padded to 2 digits.
2933

3034
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
3135
// =============> write your answer here
36+
// The value assigned to num when pad is called for the last time is 1, which is the value of remainingSeconds. This is because 61 seconds has 1 remaining second after accounting for the full minute.
3237

3338
// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
3439
// =============> write your answer here
40+
// The return value of pad when called for the last time is "01", which is the string representation of remainingSeconds padded to 2 digits.

0 commit comments

Comments
 (0)