Help please! Cannot find my Syntax error!


#1


var user= prompt("You're going to Disneyland, do you want to RIDE, EAT, or RELAX?").toUpperCase();
switch(user){
    case 'RIDE':
    var Ride1= prompt("Do you want to ride Space Mountain?").toLowerCase();
    var Ride2=prompt("Do you want to ride Splash Mountain?").toLowerCase();
    if (Ride1 ==='yes' || Ride2==='yes'){
        console.log("Good Choice, we should go on those first!");
    } else{
        console.log("All of the other rides are a waste of time!");
    }
    break;
    case 'EAT':
    var Food1= prompt("Do you want a Turkey Leg").toLowerCase();
    var Food2= prompt("Do you want some ice cream").toLowerCase();
        if(Food1==='yes'&&Food2==='yes'){
        console.log("Lets go, I'm starving");
    }else{
        console.log("Everything else is too expensive!");
    }
    break;
    case 'RELAX'
    var chill1= prompt("Do you wanna just people watch?").toLowerCase();
    var chill2= prompt("Should we find some shade?").toLowerCase();
        if(chill1==='yes'||chill2==='yes'){
        console.log("Lets find a place to sit");
    }else{
        console.log("You're right, we didn't come here to sit");
    }
    break;
    default:
    console.log("That's not an option. Run this again and choose either RIDE, EAT or Relax!");
}


#2

You missed : after case 'RELAX'.


#3

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