Skip to content

Commit 458871f

Browse files
committed
Made the changes as per the feedback.
1 parent 08cf329 commit 458871f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Sprint-1/1-key-exercises/4-random.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
88
// Function Math.random() generates a decimal number between 0 to 1 which is 0 to 0.9999
99
// Funcion (maximum-minimum + 1). Therefore it is 100 - 1 + 1 = 100
1010
// The * sign will multiply the random number with 100 which becomes 0 to 99.99
11-
// The function Math.floor will round the new number to the nearest whole number. Hence it will be 0 to 99
11+
// The function Math.floor will unconditionally round it down. Hence it will be 0 to 99
1212
// + minimum will add 1 to the new rounded up number Hence the old rance 0 - 99 will now become 1 to 100
1313
// It will help to think about the order in which expressions are evaluated
1414
// Done - Try logging the value of num and running the program several times to build an idea of what the program is doing

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ console.log(result);
2121
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
2222
// % 60 is a remainder operator which in this case divides the total by 60 and shares the remainder (seconds / minutes)
2323
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
24-
// The expression assigned to total minutes is the difference of the total movie time in seconds less the remainder of the seconds divided by 60 which gives the total length of the movie in minutes
24+
// It gives the total number of minutes in the movie, ignoring any leftover seconds.
2525
// e) What do you think the variable result represents? Can you think of a better name for this variable?
2626
// The variable result represents the time of the movie in Hours Mintutes and seconds. We could use time instead of result
2727
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
28-
// Yes. This code will work for all values of movie length. I tried with 8400 seconds and 8405 seconds
28+
// Yes. This code will work for all values of movie length. Decimal numbers or string, NAN, undefined or Null could break the code.

Sprint-1/3-mandatory-interpret/3-to-pounds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ console.log(`£${pounds}.${pence}`);
2727
// 1. const penceString = "399p": initialises a string variable with the value "399p"
2828
// 2. Line 3 Removes the letter p from the end of the string
2929
// 3. Line 8 keeps the length to 3 and adds a 0 if the length is smaller like 50p -> 050 or 5p -> 005
30-
// 4. Line 9 displays pounds from the 1st digit of the 3
30+
// 4. Line 9 calculates the pounds part from the amount by taking all digits except the last two.
3131
// 5. Line 14 displays the pence of the remaining 2 digits
3232
// 6. Line 18 converts and displays the output result on the terminal of the total in currency format of £whole with pence after the decimal
3333

0 commit comments

Comments
 (0)