Skip to content

Commit f35a334

Browse files
committed
answered 3-mandotary 2-time-format.js
1 parent ea187a8 commit f35a334

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,22 @@ 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+
// A: 6
1516

1617
// b) How many function calls are there?
18+
//A: 1
1719

1820
// c) Using documentation, explain what the expression movieLength % 60 represents
1921
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
22+
// % operate the remainder of 2 numbers divided. In this case, remainingSecond is the remainder of 8784 second (movieLength)
23+
// divided 60. And the remainingSecond is 24.
2024

2125
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
26+
//A: totalMinutes get the result form movieLength (8784) minus remainingSecond (24). The result is 8760.
27+
//The totalMinutes is 8760 divide 60 = 146.
2228

2329
// e) What do you think the variable result represents? Can you think of a better name for this variable?
30+
//A: Duration
2431

2532
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
33+
// Yes. Because the variables declaration stated clearly.

0 commit comments

Comments
 (0)