Halp meh!


#1


https://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/6?curriculum_id=506324b3a7dffd00020bf661


Did not print the less than or equal to 8 message.


var Answer2 = "No"
var age = prompt("What's your age?")
if(age < 13){
console.log("You are allowed to play, but I take no responsibility if you get in trouble.")

} else 
 (age >= 13)
    console.log("Let's go!!!")
    console.log("Are you ready?")
    console.log("As you stand there in the GameStop parking lot, you can't decide whether or not to go inside.")
    var Answer = prompt("Go inside?")
    if (Answer === "Yes"){
        ("You walk inside, and to your suprise, it's empty! You line up and buy your game.");
    } else { (Answer2 === "No") ;console.log("THE END.")
    }  
    prompt("Did you like it?")
    if (Answer === "Yes"){
    console.log("Cool.")
    } else { (Answer2 === "No")
    console.log("Oh.OK.") ; 
    }
    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
    userAnswer = prompt("Do you want to race Bieber on stage?")
    if (userAnswer === "Yes."){
        ("You and Bieber start racing. It's neck and neck! You win by a shoelace!")
    } else { 
        ("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'")}
        var feedback = prompt("Rate out of 10!")
        
        if (feedback > 8){
            ("Thanks!")
        }else{
            ("Thanks!")}
        if (feedback < 8){
            ("I'll keep practicing.")}


#2

Problem1
To print something on the screen, We use console.log() .
We put our message(string) inside it.
You missed to print messages.

Like in one of your code..

if (userAnswer === "Yes."){
("You and Bieber start racing. It's neck and neck! You win by a shoelace!")

It should be..

if (userAnswer === "Yes"){
console.log ("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
}

Problem2.
also remove dot from "Yes."

Problem3.
also look at if/else if/else structure..

if (condition1) {
    // your code
else if ( condition2) {
    //your code
}
else {
    //your code
}

You can see Im closing if/else if/else's codes with {}

Problem4.
one more line of code need to be fixed..

else { (Answer2 === "No") ;console.log("THE END.")

use the structure of if/else if/else I gave you above and fix them!


#3

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