Skip to content

Commit 8c06db1

Browse files
Answered the questions
1 parent 632b135 commit 8c06db1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ function formatTimeDisplay(seconds) {
1010

1111
return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`;
1212
}
13-
13+
console.log(formatTimeDisplay(61));
1414
// You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit
1515
// to help you answer these questions
1616

1717
// Questions
1818

1919
// a) When formatTimeDisplay is called how many times will pad be called?
20-
// =============> write your answer here
20+
// =============> write your answer here : 3
2121

2222
// Call formatTimeDisplay with an input of 61, now answer the following:
2323

2424
// b) What is the value assigned to num when pad is called for the first time?
25-
// =============> write your answer here
25+
// =============> write your answer here : 0
2626

2727
// c) What is the return value of pad is called for the first time?
28-
// =============> write your answer here
28+
// =============> write your answer here : 00
2929

3030
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
31-
// =============> write your answer here
31+
// =============> write your answer here: 01, because it the remaining of 61/60.
3232

3333
// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
34-
// =============> write your answer here
34+
// =============> write your answer here: 01, it's the remainder of 61/60, and it is padded to 2 digits.

0 commit comments

Comments
 (0)