Skip to content

Commit 6640d9e

Browse files
author
Pretty Taruvinga
committed
completing the answers to the questions
1 parent 2e6073a commit 6640d9e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@ function formatTimeDisplay(seconds) {
1818

1919
// a) When formatTimeDisplay is called how many times will pad be called?
2020
// =============> write your answer here
21-
21+
// Pad will be called 3 times when formatTimeDisplay is called, once for each of the total hours, remaining minutes, and remaining seconds.
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?
2525
// =============> write your answer here
26-
26+
// When pad is called for the first time, the value assigned to num is 0, which is the total hours calculated from the input of 61 seconds. This is because 61 seconds is equal to 1 minute and 1 second, which means there are 0 total hours in that time duration.
2727
// c) What is the return value of pad is called for the first time?
2828
// =============> write your answer here
29+
// The return value of pad when called for the first time is "00", because 0 padded to 2 digits is "00".
2930

3031
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
3132
// =============> write your answer here
33+
// When pad is called for the last time, the value assigned to num is 1, which is the remaining seconds calculated from the input of 61 seconds. This is because 61 seconds is equal to 1 minute and 1 second, so there is 1 second remaining after accounting for the full minutes.
3234

3335
// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
3436
// =============> write your answer here
37+
// The return value assigned to num when pad is called for the last time in this program is "01", because 1 padded to 2 digits is "01".

0 commit comments

Comments
 (0)