Skip to content

Commit 22e28cd

Browse files
completed_time-format.js
1 parent 04ae366 commit 22e28cd

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+
// a) 6
1516

1617
// b) How many function calls are there?
18+
// b) 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+
// c) This expression shows the remaining part after dividing one number by another.
23+
// This way we find out how many seconds are not enough to make up a full minute.
2024

2125
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
26+
// d) This way, we find out how many full minutes the film lasts.
2227

2328
// e) What do you think the variable result represents? Can you think of a better name for this variable?
29+
// e) This variable stores information about the exact length of the film (hours:minutes:seconds). I would call it “hoursMinutesSeconds”
2430

2531
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
32+
// f) I tried several values where the length of the film is 0 or only a few minutes/seconds, etc. The code works in all the cases I tried and returns 0 as the result if the film, for example, is less than an hour long.

0 commit comments

Comments
 (0)