You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sprint-1/1-key-exercises/1-count.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,5 @@ let count = 0;
2
2
3
3
count=count+1;
4
4
5
-
// Line 1 makes a variable called count and gives the value 0. Line 3 ads 1 to the value of count. So after line 3, count has the value 1. If we were to run line 3 again, count would have the value 2. If we were to run line 3 again, count would have the value 3. And so on. Each time we run line 3, we add 1 to the value of count.
5
+
// line 1 makes box called count and puts 0 inside it.
// % is the remainder after dividing movielenth by 60. It gives us the number of seconds that are left over after we have taken out all the whole minutes from the movie length
32
+
33
+
34
+
21
35
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
36
+
// first remove the extra seconds.
37
+
// then divide by 60 to get the total number of minutes in the movie length.
22
38
23
39
// e) What do you think the variable result represents? Can you think of a better name for this variable?
40
+
// The variable result represents the formatted time in hours:minutes:seconds format.
41
+
// A better name for this varibale could be formattedTime.
24
42
25
43
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
44
+
// no, this code will not work good for all values of movielength.
45
+
// it will only right for postitive whole number of seconds.
46
+
// if movieLength is nagatuve or not a whole number, the result will not be right.
0 commit comments