Skip to content

Commit 996180e

Browse files
committed
time-format.js file update
1 parent 6be81b5 commit 996180e

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

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

Lines changed: 16 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 = 10652; // length of movie in seconds
22

33
const remainingSeconds = movieLength % 60;
44
const totalMinutes = (movieLength - remainingSeconds) / 60;
@@ -23,3 +23,18 @@ 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+
// Answers
28+
29+
// a) 6
30+
31+
// b) One function call is on this code - console.log() in line 10.
32+
33+
// c) The remainder (%) operator returns the remainder left over when one operand is divided by a second
34+
// operand. It always takes the sign of the dividend.
35+
36+
// d) In line 4 the totalHours is calculated by subtracting the remainingMinutes from the totalMinutes and then dividing that answer by 60
37+
38+
// e) It is a string representing the time movie time in hours, minutes and seconds
39+
40+
// f) yes, because the variables for calculating the results use a formulas that will work with any number that is assigned to the movieLength variable

0 commit comments

Comments
 (0)