6.Asking for feedback


#1

confirm ("I am ready to play!");
var age = prompt("What's your age");
if(age<13) {
console.log("You are allowed to play without my responsability")
}
else {
console.log("Come on, let's play it!!")}
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 songs 'I set a pace, so I can race without pacing.'")
}
var feedback = prompt("Rate your 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 and racing.")
}

Whats wrong in this code?!?!?! In save and submit it appears a message "It looks like you didn't print the less than or equal to 8 message."

Thank you!


#2

Try

if (feedback >= 8) {
 //do something
}
else {
//do something
}

#3

It appears the same sentence :frowning: I've tried...


#4

@ivoclemente

Hi,
Bieber sings, he didn't songs (song isn't a verb anyways)


#5

I changed the word songs by sings but it appears the same error...... "It looks like you didn't print the less than or equal to 8 message."


#6

I changed the word songs by sings but it appears the same error...... "It looks like you didn't print the less than or equal to 8 message."


#7

@ivoclemente

Do not use = in this case because you are comparing, not assigning value. Use === instead for comparison.


#8

It appears the same :frowning: :frowning: :frowning:


#9

@ivoclemente

I've got this and it worked. I don't think you should put an => sign.


#10

confirm ("I am ready to play!");
var age = prompt("What's your age");
if(age<13) {
console.log("You are allowed to play without my responsability")
}
else {
console.log("Come on, let's play it!!")}
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 your 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 and racing.")
}

It worked!??!!


#11

@ivoclemente

This should be:


console.log("I'll keep practicing coding and racing.");


#12

yeahhh.....omg.....how a little mistake could stop us...... miniapple8888, many thanks for all help, problem solved!!!!
Thanks for your help :slight_smile: