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 @@ -16,10 +16,23 @@ console.log(result);
1616// b) How many function calls are there?
1717
1818// c) Using documentation, explain what the expression movieLength % 60 represents
19- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
2019
2120// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
2221
2322// e) What do you think the variable result represents? Can you think of a better name for this variable?
2423
2524// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
25+
26+ // answers
27+
28+ // a) 6 variable declarations
29+
30+ // b) 1 function call
31+
32+ // c) % gives the remainder after division. movieLength % 60 gives the remaining seconds
33+
34+ // d) It removes the remaining seconds and converts the rest from seconds into minutes
35+
36+ // e) It represents the movie duration as hours:minutes:seconds. A better name is movieDuration
37+
38+ // f) It works for positive whole numbers representing seconds, but not all possible values
You can’t perform that action at this time.
0 commit comments