File tree Expand file tree Collapse file tree
Sprint-3/4-mandatory-interpret Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,17 +22,30 @@ function formatTimeDisplay(seconds) {
2222
2323// a) When formatTimeDisplay is called how many times will pad be called?
2424// =============> write your answer here
25+ // 3
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+ // num = 0
3032
3133// c) What is the return value of pad when it 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+ // num = 1
40+ // The three calls are:
41+ // pad(totalHours) -> pad(0)
42+ // pad(remainingMinutes) -> pad(1)
43+ // pad(remainingSeconds) -> pad(1)
44+ // Therefore, the last call receives 1 as num.
3645
3746// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
3847// =============> write your answer here
48+ // "01"
49+ // num is 1, so numString starts as "1".
50+ // Because its length is less than 2, "0" is added to the beginning.
51+ // The function returns "01".
You can’t perform that action at this time.
0 commit comments