Skip to content

Commit 9fd849a

Browse files
Ensure my answers reflex in this file.
1 parent a7ab41d commit 9fd849a

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const movieLength = 8784; // length of movie in seconds
1+
const movieLength = -8784; // length of movie in seconds
22

33
const remainingSeconds = movieLength % 60;
44
const totalMinutes = (movieLength - remainingSeconds) / 60;
@@ -23,3 +23,20 @@ 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+
28+
29+
// a) 6 variables declarations.
30+
31+
// b) 1 function call.
32+
33+
/* c) The remainder (%) operator returns the remainder left over when one operand is divided by a second operand. It always takes the sign of the dividend.
34+
In this case it will give the remainder of 8748 % 60 */
35+
36+
// d) It simply wants to get the length of the movie in minutes. subtract the remaining seconds from the movie length and convert to minutes.
37+
38+
// e) It represents the movie durations in hours, minutes and seconds. (movie duration).
39+
40+
/*f) I have tried three values and it worked. It will work perfectly for larger and smaller numbers.
41+
However, with negative values it gives negative figures.*/
42+

0 commit comments

Comments
 (0)