Skip to content

Commit 3c1d892

Browse files
committed
Answered time-format interpret questions
1 parent a550618 commit 3c1d892

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

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

1515
return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`;
1616
}
17-
17+
console.log(formatTimeDisplay(61));
1818
// You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit
1919
// to help you answer these questions
2020

2121
// Questions
2222

2323
// a) When formatTimeDisplay is called how many times will pad be called?
2424
// =============> 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?
2930
// =============> write your answer here
31+
//Ther value is 0.
3032

3133
// c) What is the return value of pad when it is called for the first time?
3234
// =============> write your answer here
35+
// The value is "00".
3336

3437
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
3538
// =============> write your answer here
39+
//The value is "1" — last call is pad(remainingSeconds), and for 61 seconds that is 1.
3640

3741
// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
3842
// =============> write your answer here
43+
//The value is ""01" — pad turns 1 into a two-digit string.

0 commit comments

Comments
 (0)