Skip to content

Commit ebba807

Browse files
answer 3.2
1 parent b6b3409 commit ebba807

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)