Skip to content

Commit 0ed56e5

Browse files
Complete time-format code interpretation exercise
1 parent 98f4de9 commit 0ed56e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ const totalHours = (totalMinutes - remainingMinutes) / 60;
99
const result = `${totalHours}:${remainingMinutes}:${remainingSeconds}`;
1010
console.log(result);
1111

12+
//Answers:
13+
//a) There are 6 variable declarations in this program. They are on lines 1,3,4,6,7, and 9.
14+
//b) There is 1 function call in this program. It is on line 9.
15+
//c) The expression movieLength % 60 represents the remainder when movieLength is divided by 60.
16+
//d) The expression convert the total movie length into minutes, ignoring the leftover seconds.
17+
//e) The variable result represents the total length of the movie in hours, minutes, and seconds.
18+
// a better name is movieLength
19+
//f) This code work perfectly for positive numbers> However, it doesn't work for negative or very large numbers, and decimals.
20+
21+
22+
23+
1224
// For the piece of code above, read the code and then answer the following questions
1325

1426
// a) How many variable declarations are there in this program?

0 commit comments

Comments
 (0)