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
// For the piece of code above, read the code and then answer the following questions
@@ -24,9 +23,10 @@ const result = `${totalHours}:${remainingMinutes}:${remainingSeconds}`;
24
23
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
25
24
// it means that the movie hour is being calculated. totalminutes minus remainingseconds divided by 60.
26
25
// e) What do you think the variable result represents? Can you think of a better name for this variable?
27
-
// the variable result represents the total length of the movie in hours and minutes.
28
-
//Better name is MOvieTime.
26
+
// the variable result represents the total length it takes to watch the movie in hours and minutes.
27
+
//Better name is MovieLengthTime.
29
28
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
30
-
// Yes, this code will work for all values because it is using the modulus operator to calculate the remaining seconds and is using division to calculate the total hours.
29
+
// Yes, this code will work for different values of movieLength because it calculates the total hours, minutes and seconds based on the length of the movie in seconds.
31
30
// The code will correctly handle any length of movie in seconds and convert it to the appropriate format.
0 commit comments