Skip to content

Commit ab458e3

Browse files
authored
Add answers to code interpretation questions
Updated comments to provide answers to questions about the code.
1 parent b3a99c0 commit ab458e3

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ console.log(result);
1111

1212
// For the piece of code above, read the code and then answer the following questions
1313

14-
// a) How many variable declarations are there in this program?
14+
// a) How many variable declarations are there in this program?6
1515

16-
// b) How many function calls are there?
16+
// b) How many function calls are there?1
1717

1818
// c) Using documentation, explain what the expression movieLength % 60 represents
19+
//The % operator is called the remainder operator.
20+
//It gives you the remainder left over after division.
1921
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
2022

21-
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
23+
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?This removes the seconds that don't make up a complete minute.
2224

23-
// e) What do you think the variable result represents? Can you think of a better name for this variable?
25+
// e) What do you think the variable result represents? Can you think of a better name for this variable?creates a formatted representation of the movie's length in hours, minutes, and seconds.
2426

2527
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
28+
//Works properly for non-negative whole-number seconds; decimals/negative values cause formatting problems
29+
30+
31+

0 commit comments

Comments
 (0)