Skip to content

Commit 498392d

Browse files
committed
Complete Sprint 2 mandatory interpret
1 parent 83516b7 commit 498392d

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,20 @@ function formatTimeDisplay(seconds) {
2121
// Questions
2222

2323
// a) When formatTimeDisplay is called how many times will pad be called?
24-
// =============> write your answer here
24+
// Answer: 3 times
2525

2626
// Call formatTimeDisplay with an input of 61, now answer the following:
2727

2828
// b) What is the value assigned to num when pad is called for the first time?
29-
// =============> write your answer here
29+
// Answer: 0
3030

31-
// c) What is the return value of pad is called for the first time?
32-
// =============> write your answer here
31+
// c) What is the return value of pad when it is called for the first time?
32+
// Answer: "00"
3333

34-
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
35-
// =============> write your answer here
34+
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
35+
// Answer: 1
36+
// Explanation: The last call to pad is pad(remainingSeconds). When the input is 61 seconds, the remaining seconds are 1.
3637

37-
// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
38-
// =============> write your answer here
38+
// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
39+
// Answer: "01"
40+
// Explanation: The pad function adds a leading zero to numbers with only one digit, so 1 becomes "01".

0 commit comments

Comments
 (0)