-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.JS
More file actions
21 lines (15 loc) · 724 Bytes
/
main.JS
File metadata and controls
21 lines (15 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
let raceNumber = Math.floor(Math.random() * 1000);
let runnerEarly = true;
let runnerAge = Math.floor(Math.random() * 80);
if(runnerAge > 65){
console.log(`At age ${runnerAge}, you're too old to participate. Better luck next time Grandpa!`);
} else{
runnerEarly && runnerAge >= 18 ? raceNumber +=1000 : raceNumber;
if(runnerEarly && runnerAge >= 18){
console.log(`Runner ${raceNumber}, your race time is 9:30am.`)
} else if(runnerEarly === false && runnerAge >= 18){
console.log(`Runner ${raceNumber}, your race time is 11:00am.`)
} else if(runnerAge < 18){
console.log(`Runner ${raceNumber}, your race time is 12:30pm.`);
} else{console.log('You did not register')};
}