5.The story heats up!


#1

what is wrong with my code?

// Check if the user is ready to play!
confirm("Ready to play!?");
var age= prompt("What's your age")
if(age<13){
console.log ("Allowed to play but I take no responsibility");
}else{
console.log ("Enjoy the game!");
}
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 then die from being in such a close proximity to the disgusting Justin Bieber");
} else {
console.log("You just saved your life!!!!!");}

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


#2

You have to use the option it gives you.


#3

i don't understand please explain


#4

what should the code look like


#5

I don't understand this


#6

You need to use the if/else statement it gives you.


#7

i figured it out i just needed to change what was in the console.log


#8

That's what i meant.


#9

:smile::smile::smile: your welcome


#10

I'm having the same problem.


#11

@codenatesysarchitect any idea?


#12

you put control.log instead of console.log


#13

you are missing semicolons on some of the sentences.


#14

Do EXACTLY What the instructions say. Even if you miss one letter it will screw everything up!


#15

// Check if the user is ready to play!
confirm("I am ready to rock this")
var age=prompt("What's your age");
if(age>13)
{
console.log("Come this way");
}
else
{console.log("Not my fault if you get in trouble");
}
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 shoelace");
else
{
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");

----Help?? I think I just need to take a break at this point. Anything obviously wrong with this code?


#16

I guess you didn't use } this bracket to close the statement


#17

You are missing two }

on before the final else, and another one to close the entire code.


#18

I realized that if you don't include the previos code, you won't get it right.

// Check if the user is ready to play!
confirm("I am ready to rock this")
var age = prompt("What's your age");
if (age > 13) {
    console.log("Come this way");
} else {
    console.log("Not my fault if you get in trouble");
}

#19

confirm("i understand confirm")
var age = prompt("what's your age")

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?'")
userAnswer = prompt("Do you want to race me Bieber on stage?")
if(userAnswer==="yes")
{
console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
}
else
{
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}

Does anyone know what i have done wrong?