Skip to content

Commit d3bb259

Browse files
committed
interpret is done
1 parent 6549aaa commit d3bb259

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,29 @@ function formatTimeDisplay(seconds) {
1111
return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`;
1212
}
1313

14+
console.log(formatTimeDisplay(61));
15+
16+
1417
// You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit
1518
// to help you answer these questions
1619

1720
// Questions
1821

1922
// a) When formatTimeDisplay is called how many times will pad be called?
20-
// =============> write your answer here
23+
// =============> pad() function will be called 3 times.
2124

2225
// Call formatTimeDisplay with an input of 61, now answer the following:
2326

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

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

3033
// 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
34+
// =============> 1
35+
// the last pad, shows the remaining seconds (61 % 60 = 1), and it is 1.
3236

3337
// 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
38+
// =============> 01
39+
// The return value assigned to num when pad is called for the last time shows the seconds and it is 1

0 commit comments

Comments
 (0)