Skip to content

Commit 1177a65

Browse files
committed
correction
1 parent 52a9d62 commit 1177a65

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ const maximum = 100;
33

44
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
55

6+
console.log(num)
7+
68

79
// In this exercise, you will need to work out what num represents?
810
// Try breaking down the expression and using documentation to explain what it mean
911
// It will help to think about the order in which expressions are evaluated
1012

11-
// Try logging the value of num and running the program several times to build an idea of what the program is doingnum reprents the number is randomly generated whole number betweeb 1 and 100,inclusive range is between 0 and 99.99999
12-
13-
//Math.random() returns a random decimal between 0(inclusive) and 1(exclusive). while maximum-minimum +1=100, Math.random()*(maximum-minimum+1)
13+
// Try logging the value of num and running the program several times to build an idea of what the program is doing.
1414

15-
//Due to that Math.floor(...) rounds down the decimal to the nearest whole number.From this Stage, we have interger between o and 99.After + minimum, the range is between 1 and 100.
16-
//This is classcial expressions for generating a random integer between two values- between 1 and 100, inclusive in this function.
15+
//Math.random() returns a random decimal between 0(inclusive) and 1(exclusive). while maximum-minimum +1=100,+1 is important — it makes the range inclusive (so 100 is possible).
16+
//Math.floor(...) rounds down the decimal to the nearest whole number.From this Stage, we have integer between o and 99.After + minimum, the range is between 1 and 100.
17+
//num represents a random whole number between 1 and 100 (inclusive).It is the standard way to generate a random integer between min and max inclusive.
18+
//This is classical expressions for generating a random integer between two values- between 1 and 100, inclusive in this function.
1719
//This kind of expression is commonly used for things like: rolling dice,random quiz questions, game mechanics.

Sprint-1/2-mandatory-errors/0.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// This is just an instruction for the first activity - but it is just for human consumption
22
// We don't want the computer to run these 2 lines - how can we solve this problem?
33

4-
In JavaScript, we put // in front of sentence which is only for human to read.
4+
//In JavaScript, we put // in front of sentence which is only for human to read.

0 commit comments

Comments
 (0)