File tree Expand file tree Collapse file tree
Sprint-2/3-mandatory-interpret Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- const movieLength = 8784 ; // length of movie in seconds
1+ const movieLength = - 90.5 ; // length of movie in seconds
22
33const remainingSeconds = movieLength % 60 ;
44const 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.
You can’t perform that action at this time.
0 commit comments