-
-
Save codecademydev/42815517c8a690eaa51457a821a5c519 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*let raceNumber = Math.floor(Math.random() * 1000);*/ | |
let raceNumber ; | |
let earlyRegistration = Math.floor(Math.random()*2); | |
let runnerAge = Math.floor(Math.random()*100+1); | |
let Adult; | |
if (earlyRegistration === 1 && runnerAge > 18){ | |
Adult = true ; | |
raceNumber = Math.floor(Math.random() * 1000); | |
console.log(`Number ${raceNumber} your race starts at 9:30 AM!`); | |
} else if (earlyRegistration === 0 && runnerAge > 18) { | |
Adult = true ; | |
raceNumber = Math.floor(Math.random() * 1000 + 1000); | |
console.log(`Number ${raceNumber} you are late and your race starts at 11:00 AM`); | |
} else if (runnerAge < 18 ){ | |
Adult = false ; | |
raceNumber = Math.floor(Math.random() * 1000); | |
console.log(`Youngster your number is ${raceNumber} and your race starts at 12:30 AM`); | |
} else { | |
console.log(`You should see the registration desk`) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment