Skip to content

Commit f80713c

Browse files
committed
complete ex time-format.js
1 parent acc0e01 commit f80713c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

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

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

1515
return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`;
1616
}
17+
console.log(formatTimeDisplay(61));
1718

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+
// =============>Pad will be called 3 times: once for hours, once for minutes, and once for seconds.
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 is called, num gets the value of totalHours, which is 0.
3031

3132
// c) What is the return value of pad when it is called for the first time?
32-
// =============> write your answer here
33-
33+
// =============> the first time pad is called, it returns 00 because num is 0 and pad adds a zero in front.
3434
// 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
35+
// =============> the last time pad is called, num is 1 because there is 1 second left.
3636

3737
// 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+
// =============>the last time pad is called, it returns 01 because num is 1 and pad adds a 0 in front.

0 commit comments

Comments
 (0)