Help with the Feedback anyone?


#1

// Check if the user is ready to play!
confirm("are you ready to play")
age=prompt("What is you age");
if (age=> 13)
{
console.log(" Access granted")
}
else
{
console.log("DENY!!")
}
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 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.'");
}
feedback=prompt("rate game 1-10")
if(feedback=>8)
{
console.log ( 'edited for profanity' );
}
else
{
console.log( 'edited for profanity' );
}


#2

You have wrong if/else syntax. Inside the ( ) should be condtion which is an expession. Expression should returns boolean value:

if (condition) {
    block of code to be executed if the condition is true
} else { 
    block of code to be executed if the condition is false
}

In your case condition should be userAnswer === "yes".
But you have one more problem. You are using wrong comparsion operators, you need to use:

>	greater than
<	less than
>=	greater than or equal to
<=	less than or equal to

#3

Thanks man super I'm super new to this.


#4

confirm("are you ready to play")
age=prompt("What is you age");
if (age=> 13){
console.log(" Access granted")
}
else{
console.log("DENY!!")
}
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 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.'");
}
feedback=prompt("rate game 1-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.");
}

this code worked for me :slight_smile:


#5

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