Skip to content

Commit 04e573d

Browse files
committed
Correct a few answers
1 parent 2dd06dd commit 04e573d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,18 @@ console.log(result);
1414
// a) How many variable declarations are there in this program?
1515
// 6
1616
// b) How many function calls are there?
17-
// 5
17+
// 5 Fix. 1 (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
2020
// The remainder operator calculates the remainder of movie in seconds (it does it by dividing the number by 60)
21-
2221
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
2322
// total minutes (in seconds) - remaining seconds = remaining seconds. Then converts the seconds into minutes
23+
// Fix: it removes the leftover seconds that don't form a complete minute before dividing by 60 (conversion to minutes) in order
24+
// to avoid a messy decimal
2425
// e) What do you think the variable result represents? Can you think of a better name for this variable?
2526
// It represents how much of the movie is left to watch. Maybe something like remainderOfTheMovie
27+
// It represents a total movie length, so could be named totalMovieLength
2628
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
27-
// It won't work with all values. Most importantly, the value must be strictly numeric and positive
29+
// It won't work with all values. Most importantly, the value must be strictly numeric and positive. Addition: and not messy ()
30+
2831

29-
console.log(result);

0 commit comments

Comments
 (0)