#5 Code your own adventure


#1


https://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/5?curriculum_id=506324b3a7dffd00020bf661

Oops, try again. Did you remember to put in the 'yes' answer option?


// Check if the user is ready to play!
confirm ("I am ready to play");
var age = prompt("What's your age");
if (age < 13) {
console.log ("You are old enough to play") }
else {
 console.log ("You can play, but we take no responsibilty for any emotional trauma.") }
console.log ("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'")
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'")
var userAnswer = prompt ("Do you want to race Bieber on stage?");
if (userAnswer === "yes") {
console.log ("You and Bieber start racing. It's neck and neck! You win by a shoe lace!");} 
if (userAnswer === "no") {
console.log ("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");}https://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/5?curriculum_id=506324b3a7dffd00020bf661


#2

@digitalwhiz54817,
You will have to use an IF ELSE statement structure
for your code

if (userAnswer === "yes") {
console.log ("You and Bieber start racing. It's neck and neck! You win by a shoe lace!");} 
if (userAnswer === "no") {
console.log ("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without

#3

if (userAnswer === "yes") {
console.log ("You and Bieber start racing. It's neck and neck! You win by a shoe lace!");}
else {
console.log ("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race withoutpacing.'");
}

thanks