Skip to content

Commit a685e57

Browse files
authored
Update 2-time-format.js
1 parent 54103f9 commit a685e57

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
//ANSWER: There were six variable declarations
1616
// b) How many function calls are there?
17-
17+
//ANSWER: There were no function calls except for the log() 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+
//ANSWER: 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+
//ANSWER: Line 4 with find the remainder whenmovieLength is divided by 60 and assigns the remainder to remainingSeconds (24)
2323
// e) What do you think the variable result represents? Can you think of a better name for this variable?
24-
24+
//ANSWER: The variable result represents the total lenth of the movie which shows the total hours, minutes and seconds remain in string format.
25+
// A better name will be movieTotalTime.
2526
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
27+
//ANSWER: The code semed to work for all values of movieLength.

0 commit comments

Comments
 (0)