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
//The remainder (%) operator returns the remainder left over when one operand is divided by a second operand.
24
+
// It always takes the sign of the dividend.
20
25
21
26
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
27
+
// The value stored in totalMinute is calculating the number of minutes that have elapsed in the movie by subtracting the remaining time from the total duration and converting seconds to minutes.
22
28
23
29
// e) What do you think the variable result represents? Can you think of a better name for this variable?
30
+
//The variable result represents a formatted time string in the format HH:MM:SS.
31
+
// A better name would be "movieDurationDisplay", as these names more clearly describe the purpose and content of the variable.
24
32
25
33
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
34
+
// No. Not for all possible values of movieLength, some EdgeCases are:
35
+
//1. when movieLength is of negative value, the maths produces negative time and its illogical for a movie duration
36
+
//2. if movieLength is not a number, its produces "NAN" and this breaks mathematically
0 commit comments