Skip to content

Commit 67c8968

Browse files
authored
generating time format for duration of a movie
1 parent 4ba270e commit 67c8968

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@ console.log(result);
1212
// For the piece of code above, read the code and then answer the following questions
1313

1414
// a) How many variable declarations are there in this program?
15+
// there are 6 variable declaration
1516

1617
// b) How many function calls are there?
18+
// there is one function call (console.log())
1719

1820
// c) Using documentation, explain what the expression movieLength % 60 represents
21+
// it represents the remaining of dividing movielength by 60
1922
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
2023

2124
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
25+
// it means the integer quotient of dividing movieLength by 60
2226

2327
// e) What do you think the variable result represents? Can you think of a better name for this variable?
28+
// it represents the length of the movie in hours, minutes and seconds format
29+
// a better name would be: movieTimeVolume
2430

2531
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
32+
// no it will not work for negative input values as it gives negative results

0 commit comments

Comments
 (0)