Skip to content

Commit 3c9fb3a

Browse files
committed
Key exercise part is done with this commit
1 parent 84e3bca commit 3c9fb3a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
const minimum = 1;
22
const maximum = 100;
3+
const num = 2;
34

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

67
// In this exercise, you will need to work out what num represents?
78
// Try breaking down the expression and using documentation to explain what it means
89
// It will help to think about the order in which expressions are evaluated
910
// Try logging the value of num and running the program several times to build an idea of what the program is doing
11+
12+
13+
14+
// SOLUTION:
15+
16+
// num represents a random number between the minimum and maximum values.
17+
18+
// program is designed for num to return random numbers between 1-100.
19+
20+
//expressions of math.floor and math.random are there for //generating a random number between the minimum and maximum values and then rounding it down to the nearest whole number...

0 commit comments

Comments
 (0)