Skip to content

Commit 4be47f2

Browse files
committed
Answered the questions
1 parent 5b6ddbd commit 4be47f2

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ 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, line1,3,4,6,7,9
1616
// b) How many function calls are there?
17-
17+
// 1, Line 10: console.log()
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+
// The modulo operator divides the movieLength in seconds by 60 and give the remainder
2121
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
22-
22+
// It calculates the total number of whole minutes in the movie by subtracting the remainingSeconds from the total movie then divides the answer by 60 to covert seconds to minutes.
2323
// e) What do you think the variable result represents? Can you think of a better name for this variable?
24-
24+
// This variable represents the movie duration in the form of hours:minutes:seconds. better name id duration.
2525
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
26+
// The code will run for all non negative whole number.

0 commit comments

Comments
 (0)