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
// In this exercise, you will need to work out what num represents?
7
8
// Try breaking down the expression and using documentation to explain what it mean
8
9
// It will help to think about the order in which expressions are evaluated
9
10
10
-
// 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
// 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)
14
+
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.
17
+
//This kind of expression is commonly used for things like: rolling dice,random quiz questions, game mechanics.
0 commit comments