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
// Answer: The expression movieLength % 60 represents the remainder when movieLength is divided by 60
20
23
21
24
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
25
+
// Answer: The expression assigned to totalMinutes subtracts the leftover seconds from the movieLength and divide it by 60 to get the totalMinutes.
26
+
// This gives the total whole minutes of the movie without the leftover seconds.
22
27
23
28
// e) What do you think the variable result represents? Can you think of a better name for this variable?
29
+
// Answer: The variable result represents the time in hours, minutes and seconds. A better name for the variable could be totalTime
24
30
25
31
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
32
+
// Answer: I tried different positive values of movieLength and the code worked for all but result variable returned a negative value when I tried a negative number as the variable movieLength
0 commit comments