5 The story heats up! HELP!


#1

Can someone help me with #5, I have the error message "Oops, try again. Did you remember to put in the 'yes' answer option?"

I had the yes in my code. I still get the error message when i enter yes in the prompt box. My code is below:

// Check if the user is ready to play!
confirm("Are you ready to play?")
var age = prompt ("The age limit for this game is 13, What's your age");
if (age > 13) {
console.log("The age limit for this game is 13, play at your own risk")
}
else{
console.log("Enjoy and and Play on!")
}
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 the stage?");

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


#3

I have the same problem, I've done it over and over and it still doesn't work.
Here's what I put:
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.'")}

And here's what it says:
Oops, try again. Did you add an if statement to your code?


#4

hey guys, i got it to work correctly. dont know whats so different in our codes but this is my code

confirm("Are you Ready to play?!?");
var age = prompt("What's your age?");
if (age < 13) {
console.log("You are allowed to play, but i don't take any responsibility.");
}
else {
console.log("Goodluck! May the best player Win.");
}
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.'");
}
var feedback = prompt("Rate my game out of 10!");
if ( feedback > 8 ) {
console.log("Thank you! We should race at the next concert!");
}
else {
console.log("I'll keep practicing coding and racing.");
}


#5

I think you need to still use the confirming and age part. Maybe it will work for u. Hope it might be a possible solution! ;D


#6

thank you so much!! This really helped!