Skip to content

Commit f48e433

Browse files
committed
quesiton answered
1 parent ff6aac5 commit f48e433

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Sprint-1/3-mandatory-interpret/2-time-format.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,24 @@ console.log(result);
2323
// e) What do you think the variable result represents? Can you think of a better name for this variable?
2424

2525
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
26+
27+
// Answer a: there are 6 variable declarations which are const movieLength, const remaininingSeconds, const totalMinutes, const remainingMinutes,
28+
// cost totalHours and const result.
29+
30+
// Answer b: only one function call which is console.log(result).
31+
32+
// Answer c: it means the number of seconds left after removing all full minutes". so 8784%60=24, So there are 24 seconds remaining after
33+
// converting to full minutes.It gives the number of seconds left after dividing total seconds into whole minute.
34+
35+
// Answer d:it calculates the number of full minutes in the total movie length. so 8784-24=8760/60=146 minutes
36+
37+
// Answer e: this builds a string representing the time in HH:MM:SS format, based on the movie length in seconds. The better name can be
38+
// formattedTime or timeString.
39+
40+
// Answer e: It will work for most large intergers or large hours but it does not work well for time below 60 seconds like 37 seconds is
41+
// 0:0:37 which can be considered unformatted. What is more, it does not handle negative numbers and does not pad numbers with zero.
42+
43+
44+
45+
46+

0 commit comments

Comments
 (0)