Skip to content

Commit b93870e

Browse files
completed the time format specification file
1 parent 6db1797 commit b93870e

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,27 @@ function formatTimeDisplay(seconds) {
1515
return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`;
1616
}
1717

18+
console.log(formatTimeDisplay(61));
1819
// You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit
1920
// to help you answer these questions
2021

2122
// Questions
2223

2324
// a) When formatTimeDisplay is called how many times will pad be called?
24-
// =============> write your answer here
25+
// =============> 3 times
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?
29-
// =============> write your answer here
30+
// =============> the first time pad was called with 61 the value is 00:01:01
3031

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

3435
// 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
36+
// =============> 1
37+
// the last time, pad() is called with the remaining seconds which is value 1
3638

3739
// 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
40+
// =============> 1
41+
// the return value is "1" but as we are using pad would be adding a leading of "0" to become "01"

0 commit comments

Comments
 (0)