6. Asking for feedback


#1

This is my code keeps on displaying syntax error please help!

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


#2

@amz_478 you are missing your console.log commands -- you just have the string you want to print, but no command to print it. You also have a close parenthesis at the end of your else line, but no opening parenthesis:

}else{"I'll keep practicing coding and racing.")

#3

@freginold Thank you I've got it


#4

hi uys anyone know why im getting syntax error and then unexpected end of input. help please. pulling hair out as i cannot see what i am getting wrong // Check if the user is ready to play!
// I am ready to play!
confirm("Are you ready to play!");
var age = prompt("what is your age");
if(age>13)
{
console.log("You may play but I take no responsibility!");
}
else
{
console.log("So come on play play play, lets have some fun!");
}
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 ("what is your rating out of 10?")
if(feedback === 8)
console.log("Thankyou! We should race at the next concert!");
} else }
console.log("I'll keep practicing coding and racing.");

PLEASE HELP im not seeing the problem any help or nudge in the right diretion anyone :smile:


#5

@kelra1 Hi, Your if statement is wrong needs, to be if( feedback >= 8). Try this it should work!


#6

of course thanks will give that a try now :smile:


#7

var feedback = prompt("What is your rating out of 10?");
if(feedback>=8)
console.log("Thankyou! We should race at the next concert!");
} else }
console.log("I'll keep practicing coding and racing.");

this is still wrong, its prob something simple that i am totally missing..........thanks for your help :smiley:


#8

You had your start code end codes mixed up. before your first statement it should have { Symbolizing the start of the code like this code that passed. Hope that helps!

var feedback = prompt ("what is your rating 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.");
}


#9

Please help I do not know whats wrong and it keeps coming up with SyntaxError: Syntax error

feedback = prompt("Out on a scale of 1 to 10 what is your rating of this game?")
if (feedback > 8)
{
console.log("Thank you! we should race at the next concert!")
}
else
{
console.log("I'll keep practicing coding and racing. ")
}


#10

look at your spaces between things again...you may see what is wrong, check it against the above if it helps as this was right in the end :smile:


#11

Getting same syntax error for this part of lesson. Here is my code

var feedback
feedback=prompt("plese provide rating 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.")
}

Any suggestion about what might be wrong.


#12

var feedback = prompt("Message");
if (feedback > 8) {
console.log("Thank you! We should race at the next concert!")
}
else {
console.log("I'll keep practicing coding and racing.")
}

here try this it worked for me


#13

Can any one help me with my syntax error
var feedback = prompt("Rate this game out of 10");
if (feedback is >=8){
console.log("Thank you! We should race at the next concert!");
}
else(feedback is < 8){
console.log("I'll keep practicing coding and racing.");
}


#14

Please help me, i need help trying to figure out why this message keep popping up: Unexpected token else. here is my code:

var feedback = prompt("Message");
if (feedback > 8) {
console.log("Thank you! We should race at the next concert!")
}
else {
console.log("I'll keep practicing coding and racing.")
}


#15

its worked!!!! :smile:


#16

This is my code:

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.");
}

It keeps saying SyntaxError: Expected '}' but I can't figure out where to put it. Please help. It's probably some simple mistake I am just not seeing.


#17

I seem to be stuck. I've been going over this for a while now and can't figure out what I'm missing. Thanks for the help!

// Check if the user is ready to play!
confirm("Begin your adventure");
var age = prompt("What's your age?");

if(age < 13)
{
    console.log("You are too young for this imaginary graphic game!");
}
else(age > 13)
{
    console.log("You are old enough to embark on this journey. Go forth adventurer!");
}
    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("How would you rate this 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.");
}