File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Sprint-1/3-mandatory-interpret Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,11 @@ const totalHours = (totalMinutes - remainingMinutes) / 60;
88
99const result = `${ totalHours } :${ remainingMinutes } :${ remainingSeconds } ` ;
1010console . log ( result ) ;
11-
11+ let movieDuration = `${ totalHours } :${ remainingMinutes } :${ remainingSeconds } ` ;
12+ console . log ( movieDuration ) ;
1213// For the piece of code above, read the code and then answer the following questions
1314
15+
1416// a) How many variable declarations are there in this program?
1517// there is 6 variable declarations
1618
@@ -26,6 +28,9 @@ console.log(result);
2628//we are converting the seconds into minutes by dividing by 60
2729
2830// e) What do you think the variable result represents? Can you think of a better name for this variable?
29- //Duration of the movie in hours, minutes, and seconds.
31+ // we can change the name of the variable result into a clearer variable name like movieDuration
32+ //and if i want to change or update the value later i can use let instead of const
33+ // let movieDuration = `${totalHours}:${remainingMinutes}:${remainingSeconds}`;
34+ //the result will be the duration of the movie in hours, minutes, and seconds.
3035// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
3136//yes it will work for all values of movieLength because the code will always convert seconds into hours, minutes, and seconds format.
You can’t perform that action at this time.
0 commit comments