There was an error while loading. Please reload this page.
1 parent fe9563c commit 4acb026Copy full SHA for 4acb026
1 file changed
Sprint-2/1-key-exercises/4-random.js
@@ -2,8 +2,14 @@ const minimum = 1;
2
const maximum = 100;
3
4
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
5
+// (0.68 * 100 ) + 1
6
+console.log(num)
7
8
// In this exercise, you will need to work out what num represents?
9
// Try breaking down the expression and using documentation to explain what it means
10
// It will help to think about the order in which expressions are evaluated
11
// Try logging the value of num and running the program several times to build an idea of what the program is doing
12
+
13
+// Answer: For calculations i utilised BODMAS formula solving numbers in brackets first, multiplication, subtraction and addition
14
+// I used 0.68 for math.floor(random number) + 1
15
+// Sum = 69
0 commit comments