Old enough to play


#1


I am stuck on old enough to play.


I keep getting my syntax wrong because i can wrap my head around the if/else statments


// Check if the user is ready to play!
confirm ("Play?")
var age=prompt("whats your age")
if (13 <) {
 "you are too young"
} else {
  "You are eligable lets go"
}


#2

the first thing you need to do is to compare 13 to your variable

ex- age < 13

the next thing to correct is to use an output to display your strings inside the if statement

ex- alert("you are too young")


#3

can you give an example?


#4

i need an example please


#5

// Check if the user is ready to play!
confirm ("Play?")
var age=prompt("whats your age")
if (age < 13) {
"you are too young"
} else {
"You are eligable lets go"
}

Use that.
You needed to compare age to 13 and see if it is less or more, then act accordingly


#6

This was what I came up with, but it says I'm not asking for the users age.

confirm("Are the odds in your favor?");
var age = prompt("What's your age");
if(age < 18)
{ console.log("You may under your own risk continue, pray that the odds be ever in your favor.");
}
else
{ console.log("Be prepared to be tested, and may the odds be ever in your favor.");
}


#7

confirm("Are the odds in your favor?");
var age = prompt("What's your age");
if(age < 13)
{ console.log("You may under your own risk continue, pray that the odds be ever in your favor.");
}
else
{ console.log("Be prepared to be tested, and may the odds be ever in your favor.");
}


Write This and enter age 13 in brackets and when the computer ask you for it then enter age 12 ! Thats The right way ! Thank You ! Text Me For More Helps Without Any Pro Pay


#8

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