Skip to content

Commit f0d0c8b

Browse files
debug2604debug2604
authored andcommitted
Answer f) with multiple test values including negative/decimal in 2-time-format.js
1 parent bfd04f3 commit f0d0c8b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const movieLength = 8784; // length of movie in seconds
1+
const movieLength = -90.5; // length of movie in seconds
22

33
const remainingSeconds = movieLength % 60;
44
const totalMinutes = (movieLength - remainingSeconds) / 60;
@@ -30,4 +30,7 @@ console.log(result);
3030
// The variable result represents length of movie in H:M:S format. A better variable name can be movieLength_HMS
3131

3232
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
33-
// A value of movieLength 3661 will return a result of 1:1:1 where the place value for second does not conforms with leading zero time format.
33+
// A value of movieLength 3661 will return a result of 1:1:1 where the place value for second does not conforms with leading zero time format.
34+
//The code does not work for all values:
35+
//It does not pad single digits with a leading zero;
36+
//It does not validate to reject negative (e.g.-90 gives "0:-1:-30" ; -90.5 gives "0:-1:-30.5") or decimal input.

0 commit comments

Comments
 (0)