Skip to content

Commit 6cd17cc

Browse files
committed
2-interpret done
1 parent ff43f7d commit 6cd17cc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

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

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

33
const remainingSeconds = movieLength % 60;
44
const totalMinutes = (movieLength - remainingSeconds) / 60;
@@ -12,14 +12,16 @@ 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+
//6
1616
// b) How many function calls are there?
17-
17+
//
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+
//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.
2021

2122
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
22-
23+
//math expression
2324
// e) What do you think the variable result represents? Can you think of a better name for this variable?
24-
25+
//maybe timeLeft or similar
2526
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
27+
//

0 commit comments

Comments
 (0)