Update exercises
This commit is contained in:
+9
-9
@@ -28,15 +28,15 @@ while (!correct) {
|
|||||||
|
|
||||||
//Exercise #3
|
//Exercise #3
|
||||||
|
|
||||||
let tempNum = '';
|
let tempNum = '';
|
||||||
let total = prompt('How many digits in the number?');
|
let total = prompt('How many digits in the number?');
|
||||||
let max = 5;
|
let max = 5;
|
||||||
total = Number(total);
|
total = Number(total);
|
||||||
for (let x = 0; x < total; x++) {
|
for (let x = 0; x < total; x++) {
|
||||||
const ranNumber = Math.floor(Math.random() * max) + 1;
|
const ranNumber = Math.floor(Math.random() * (max + 1)) ;
|
||||||
tempNum += ranNumber;
|
tempNum += ranNumber;
|
||||||
}
|
}
|
||||||
console.log(tempNum);
|
console.log(tempNum);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user