Skip to content

Commit 8d7e2e4

Browse files
committed
time_format commit
1 parent d0ad944 commit 8d7e2e4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,20 @@ console.log(result);
1212
// For the piece of code above, read the code and then answer the following questions
1313

1414
// a) How many variable declarations are there in this program?
15+
// There are 6 variable declarations
1516

1617
// b) How many function calls are there?
18+
// There is one function call which is console.log
1719

1820
// c) Using documentation, explain what the expression movieLength % 60 represents
1921
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
22+
// % is a remainder operator which will do movieLength / 60 and we will consider the remainder of this operation
2023

2124
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
25+
// In line 4 we are declaring the totalMinutes. we have the remainingSeconds which is 24. Then we will do ((8784 - 24) /60) = 146
2226

2327
// e) What do you think the variable result represents? Can you think of a better name for this variable?
28+
// The variable result shows the total remaining duration of a movie in terms of hours, minutes and seconds
2429

2530
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
31+
// The movieLength code will work work with all kinds of number. THat is integers and floats. It will not work with strings

0 commit comments

Comments
 (0)