Skip to content

Commit 149b8cd

Browse files
committed
changed readability outlook
1 parent 27e5502 commit 149b8cd

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@ 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-
//answer: we have 6 variable declarations
15+
//answer: we have 6 variable declarations
16+
1617
// b) How many function calls are there?
17-
//answer: there is 1 function call: line 10
18+
//answer: there is 1 function call: line 10
19+
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
20-
//answer:% is a remainder operator, it calculates left over seconds when movie length is divided into full minutes
22+
//answer:% is a remainder operator, it calculates left over seconds when movie length is divided into full minutes
23+
2124
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
2225
//answer:it subtracts the left over seconds from the total movie length to get a multiple of 60, then divides by 60 to convert that duration into whole minutes.
26+
2327
// e) What do you think the variable result represents? Can you think of a better name for this variable?
24-
//answer: formatted movieLength, it represents the movieLength format as a time string
28+
//answer: formattedMovieLength, it represents the movieLength format as a time string
29+
2530
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
26-
//answer: yes it can work but only for positive numbers representing total seconds, if the movieLength is negative it will give off an output of an invalid time value
31+
//answer: yes it can work but only for positive numbers representing total seconds, if the movieLength is negative it will give off an output of an invalid time value

0 commit comments

Comments
 (0)