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
{{ message }}
Repository navigation
Commit d39bec0
Browse filesBrowse the repository at this point in the historyBrowse files
// In this exercise, you will need to work out what num represents?
7
7
// Try breaking down the expression and using documentation to explain what it means
8
8
// It will help to think about the order in which expressions are evaluated
9
9
// Try logging the value of num and running the program several times to build an idea of what the program is doing
10
+
11
+
// ANSWER
12
+
// num represents a random whole number in the range 0 - 100.
13
+
// math.random gives a random decimal between 0 and 1.math floor rounds the value to a whole number.
14
+
// (maximum - minimum + 1) evaluates the total count of integers. (+ minimum )adds 1 to the outcome.
15
+
// The code starts by evaluating math.random then multiply that by the maximum, math.floor will then round that value into a whole number then finally adding minimum to get num.
0 commit comments