Skip to content

Commit b5eb41e

Browse files
author
JorvanW
committed
time-format.js was answered in sprint-3 branch, updated to be in the the correct sprint.
1 parent b48031e commit b5eb41e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ function formatTimeDisplay(seconds) {
2121
// Questions
2222

2323
// a) When formatTimeDisplay is called how many times will pad be called?
24-
// =============> write your answer here
24+
// =============> Pad will be called 3 times, once for totalHours, once for remainingMinutes, and once for remainingSeconds.
2525

2626
// Call formatTimeDisplay with an input of 61, now answer the following:
2727

2828
// b) What is the value assigned to num when pad is called for the first time?
29-
// =============> write your answer here
29+
// =============> The value will be 0
3030

3131
// c) What is the return value of pad is called for the first time?
32-
// =============> write your answer here
32+
// =============> The return value will be "00"
3333

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 value assigned to num when pad is called for the last time in this program will be 1.Because it is the value of the remainingSeconds variable, which is calculated as 61 % 60 = 1.
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 output is "01" because the pad function adds a leading zero to the number 1, resulting in a two-character string "01".

0 commit comments

Comments
 (0)