Feedback Rate 1 to 10


#1

This is my code can any one tell me why its not working?
// Check if the user is ready to play!
confirm("I understand, confirm!");

var age = prompt("What's your age?");

if (age < 13)
{ console.log ("You are not allowed to play");
// do this code
}
else (age > 13)
//"otherwise"
{ console.log ("You are allowed to play");
//do this code
}
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?'");
if (age < 13) {
console.log("Your are beautiful no matter what they say ");
} else {
console.log("Piano by Ariana Grande");
}
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("You and Bieber start racing. It's neck and neck! You win by a shoelace!"); {
// Do something
} else { // Otherwise...
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing");
}

var feedback = prompt("Please rate my game 1 to 10");
if (feedback > 8) {
console.log("Thank you! We should race at the next concert!");
}
{
else (feedback < 8) {
console.log("I'll keep practicing coding and racing!");
}


#2

everything worked fine until the feedback part


#3

What do you mean by "not working"? What should it do differently?


#4

it said "oops try again there was a problem with your syntax"


#5

There should not be an inward facing bracket { before else

So this is what you have:

var feedback = prompt("Please rate my game 1 to 10");
if (feedback > 8) {
console.log("Thank you! We should race at the next concert!");
}
{
else (feedback < 8) {
console.log("I'll keep practicing coding and racing!");
}

This is what it should be:

var feedback = prompt("Please rate my game 1 to 10");
if (feedback > 8) {
console.log("Thank you! We should race at the next concert!");
}
else (feedback < 8) {
console.log("I'll keep practicing coding and racing!");
}


#6

thanks but i tried it and still says theres a problem with syntax..


#7

i figured it out its supposed to be this:
var feedback = prompt("Please rate my game from 1 to 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!");
}


#9

I was going to say, there was no need for the "else (feedback < 8)" - only needed to be else. Also the random "{" before it wasn't supposed to be there. apart from that, looking good!


#10

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