Skip to content

Commit 7d37691

Browse files
committed
Answer formatTimeDisplay tracing questions
1 parent f5758a2 commit 7d37691

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

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

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

2323
// a) When formatTimeDisplay is called how many times will pad be called?
24-
// =============> write your answer here
25-
26-
// Call formatTimeDisplay with an input of 61, now answer the following:
24+
// =============> 3 times
2725

2826
// b) What is the value assigned to num when pad is called for the first time?
29-
// =============> write your answer here
27+
// =============> 0
3028

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

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
32+
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
33+
// =============> 1, because formatTimeDisplay(61) has 1 remaining second,
34+
// and the last call to pad is pad(remainingSeconds).
3635

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
36+
// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
37+
// =============> "01", because pad adds a zero to the beginning of "1"
38+
// to make it two characters long.

0 commit comments

Comments
 (0)