File tree Expand file tree Collapse file tree
Sprint-2/3-mandatory-interpret Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,3 +23,19 @@ console.log(result);
2323// e) What do you think the variable result represents? Can you think of a better name for this variable?
2424
2525// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
26+
27+ // Answer
28+
29+ // a) In the above code there are 6 variable declarations
30+
31+ // b) There is only 1 function call in the code
32+
33+ // c) the expression movieLength % 60 is trying to divide the movieLength by 60 then get the remainder
34+
35+ // d) totalMinutes = (movieLength - remainingSeconds) / 60 in this expression
36+ // 1. (movieLength - remainingSeconds) the values inside the parenthesis is calculated first then it is divided by 60
37+ // then the value of expression is assigned to the var totalMinutes
38+
39+ // e) the variable result represents the formatted time in hours:minutes:seconds. I would rename it time
40+
41+ // f) it will not work with negative numbers because we can not have negative time
You can’t perform that action at this time.
0 commit comments