Skip to content

Commit 4bc0b4b

Browse files
solve exec. sprint-1/3-mandatory-interpret/2.js
1 parent 13835fb commit 4bc0b4b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ 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-
15+
//------->ans: 6
1616
// b) How many function calls are there?
17-
17+
//------->ans: 1 at the last line, that is console.log() .. it is a built-in function.
1818
// c) Using documentation, explain what the expression movieLength % 60 represents
1919
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
20-
20+
//------->ans: 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.
2121
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
22-
22+
//------->ans: (movieLength - remainingSeconds) / 60;
2323
// e) What do you think the variable result represents? Can you think of a better name for this variable?
24-
24+
//
2525
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer

0 commit comments

Comments
 (0)