You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sprint-2/4-mandatory-interpret/time-format.js
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -17,18 +17,19 @@ function formatTimeDisplay(seconds) {
17
17
// Questions
18
18
19
19
// a) When formatTimeDisplay is called how many times will pad be called?
20
-
// =============> write your answer here
20
+
// =============> 3 times, once for totalHours, once for remainingMinutes and once for remainingSeconds.
21
21
22
22
// Call formatTimeDisplay with an input of 61, now answer the following:
23
23
24
24
// b) What is the value assigned to num when pad is called for the first time?
25
-
// =============> write your answer here
25
+
// =============> 1 because the first operation is 61 % 60 which gives us 1
26
26
27
27
// c) What is the return value of pad is called for the first time?
28
-
// =============> write your answer here
28
+
// =============> 00 because the first operation is totalHours which is 0 and it is padded to 2 digits with a 0 in front of it.
29
29
30
30
// 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
+
// =============> 1 because the last operation is 1 % 60 which gives us 1
32
32
33
33
// 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
+
// =============> 01 because the last operation on the return line is remainingSeconds which is 1 and it is padded to 2 digits with a 0 in front of it.
0 commit comments