"did you remember to put yes answer option?"


#1

Hi, my code can execute and work right but, the program, does not accept it, what should i change?


This is the error:
"did you remember to put yes answer option?"


confirm ("I am ready to play")

var age = prompt ("What is your age?");

if (age < 13) {
    console.log ("you can play at your own responsability!");}
    else { 
        console.log ("Welcome to our world!!! ... muahhahahHAHAHA");}
console.log ()
console.log ("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'")
console.log ()
console.log ("Suddenly, Bieber stops and says, 'Who wants to race me?'")

var userAnswer = prompt ("Do you want to race Bieeber on stage? (yes or no)");
console.log ()
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.'")}



// tryed to change if (userAnswer = "Yes") to if (userAnswer === "Yes") , the result is the same

thank you.


#2

This all needs to be unindented once... else needs to be in line with if.

Also, you need to use

and back up

These lines once.


#3

humm, that does not solve the error when submiting the code, still have this:"did you remember to put "yes" answer option?",
i changed the userAnswer === "Yes" but still have the same error.


#4

Make sure that your cases are correct. is that the exact error message? if so, you need to use

note the lowercase y


#5

i also tryed that before =/, still, does not work.
i moved on... but the progress is not acurrate now.

and btw, thx a lot.


#6

Hello,

I am getting the exact same error "did you remember to put yes answer option?" and I tried to change
if (userAnswer = "yes") to if (userAnswer === "yes") but nothing.... how where you able to move on?


#7

honestly what i did was copy paste the solution from some user on the forum. There was no apparent difference on the code.

...

If you want, you can find the code here

    
    confirm("Are you ready to play?");
var age = prompt("What is your age?");

if ( age > 13){
    console.log("Old enough. Let the game begin.");
    }
    else if (age <13) {
         console.log("Play only with parents")};
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.'")};

#8

Thank you, I guess I'll do that... I actually didnt want to end up doing that but it may just be a glitch :slight_smile:


#9

Same, but its anoying when we want to resume from where we ended. Cheers


#10

@coresurfer05438 @ninphechoes

I dont understand why you two copy and paste the most of the code was correct.
Only a typo didnt let you go threw

You and Bieber start racing. It's neck and neck! You win by a sho w lace! // wrong
You and Bieber start racing. It's neck and neck! You win by a sho e lace! // correct


#11

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.