Skip to content

Commit 5329549

Browse files
correcting exercise 2-time-format
1 parent ed20ed5 commit 5329549

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

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

Lines changed: 7 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 = 90000; // length of movie in seconds
22

33
const remainingSeconds = movieLength % 60;
44
const totalMinutes = (movieLength - remainingSeconds) / 60;
@@ -60,8 +60,13 @@ console.log(result);
6060
/* movieLength = 0 => exactMovieLength = 0:0:0 */
6161
/* movieLength = 60 => exactMovieLength = 0:1:0 */
6262
/* movieLength = 3676 => exactMovieLength = 1:1:16 */
63+
/* movieLength = -3600 => exactMoveLenght = -1:0:0 */
64+
/* movieLength = 90000 => exactMoveLenght = 25:0:0 */
6365
/* */
64-
/* This code work for all values of movieLength provided that it doesn't exeed 86400 which is 24 hours = 1 day (realisticly no movie is over 24 hours) */
66+
/* This code work Could be better: */
67+
/* - giving a negative value for movieLength will result in a negative clock: so there could have message that reject negative numbers. */
68+
/* - The program should have represented Hours/Min/Sec in this format 00:00:00 so each time should be represented with 2 digits. */
69+
/* - 25 hours exeeds 24 hours which represents a day so a variable total days could be added to represent time in days. */
6570
/* */
6671
/**********************************************************************************************************************************************************/
6772

0 commit comments

Comments
 (0)