You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sprint-1/3-mandatory-interpret/2-time-format.js
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -23,3 +23,30 @@ console.log(result);
23
23
// e) What do you think the variable result represents? Can you think of a better name for this variable?
24
24
25
25
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
26
+
27
+
28
+
// a) There are 6 variable declarations in this program:
29
+
// which are:
30
+
31
+
// movieLength
32
+
33
+
// remainingSeconds
34
+
35
+
// totalMinutes
36
+
37
+
// remainingMinutes
38
+
39
+
// totalHours
40
+
41
+
// result
42
+
43
+
// b) There are 2 function calls in this program.
44
+
45
+
// c) Expression movieLength %60 represents remainder of division by 60.
46
+
47
+
// d) expression assigned to totalminutes means minutes in the movie by removing the remaining seconds and dividing by 60.
48
+
49
+
// e) Result variable represents the total time. A better name would be totalTime.
50
+
51
+
// f) Yes code will work for all the values of movielength. It'll always return the total time with no problems. But It's not working if movielength less than 60 seconds, more than 24 hours or negative values.
0 commit comments