File tree Expand file tree Collapse file tree
Sprint-2/4-mandatory-interpret Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,27 +12,31 @@ function formatTimeDisplay(seconds) {
1212 const remainingMinutes = totalMinutes % 60 ;
1313 const totalHours = ( totalMinutes - remainingMinutes ) / 60 ;
1414
15+ console . log ( remainingSeconds ) ;
16+
1517 return `${ pad ( totalHours ) } :${ pad ( remainingMinutes ) } :${ pad ( remainingSeconds ) } ` ;
1618}
1719
20+ console . log ( formatTimeDisplay ( 60001 ) ) ;
21+
1822// You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit
1923// to help you answer these questions
2024
2125// Questions
2226
2327// a) When formatTimeDisplay is called how many times will pad be called?
24- // =============> write your answer here
28+ // =============> 3
2529
2630// Call formatTimeDisplay with an input of 61, now answer the following:
2731
2832// b) What is the value assigned to num when pad is called for the first time?
29- // =============> write your answer here
33+ // =============> the value is totalHours which equals to (totalMinutes - remainingMinutes) / 60
3034
3135// c) What is the return value of pad is called for the first time?
32- // =============> write your answer here
36+ // =============> 16
3337
3438// 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
39+ // =============> 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
38- // =============> write your answer here
42+ // =============> 01
You can’t perform that action at this time.
0 commit comments