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
// this expression divided the movie length (is seconds) by 60 so we get how many minutes the movie length is.
23
+
// but since we used % not / that means we only took the reminder left over after dividing the number.
24
+
// so basically the code identifies how many seconds will be left over after getting the minutes amount.
20
25
21
26
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
27
+
// it means that the result of this expression will be the total minutes of the video.
28
+
// before that - in line 3 - it took the number of seconds left, and in line 4 it divides the
29
+
// movie length ( takes the remaining seconds out ) by 60 because a minute contains 60 seconds.
30
+
// so it actually converts the seconds into minutes.
22
31
23
32
// e) What do you think the variable result represents? Can you think of a better name for this variable?
33
+
// The output of the variable result represents time (period of the movie).
34
+
// it actually shows the result of converting seconds into readable time format.
35
+
// Better to call it (ReadableMovieTime).
24
36
25
37
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
38
+
// It does work with most if the values, BUT if I put a number that's bigger than 86399, which returns: 23:59:59
39
+
// that means it ignores the days, it can be mediated so it can count days, months and years.
40
+
// I haven't watched a movie that is longer than a day but just in case :), I think the code should be kind of general sometimes!!
41
+
// Also two zeros should be displayed if there're not hours or mins (when I put small numbers that are less that an hour), so it gets more understandable.
0 commit comments