Please help


#1



Replace this line with your code.


#2

What do you need help with? You only pasted one line of the assignment, and it's not even a line of code.


#3

var user = prompt("What kind of specialist are you?").toUpperCase();

var Q2 = prompt("are you afraid of fire?").toUpperCase()
if (Q1 === yes && Q2 === no);{
console.log("You will be a great fire break");
} else {
console.log("I dont think fire break is for you.");
}
break;
case 'nomad':
var Q3 = prompt( "are you combat ready?").toUpperCase()
var Q4 = prompt("Do you like bees?").toUpperCase()
if(Q3 === yes && Q4 === yes); {
console.log("Have fun use bees to your advantage");
} else {
console.log("Dont be nomad, you get stung!");
}
break;
case 'sparrow':
var Q5 = prompt("Are you combat ready?");
var Q6 = prompt("Are you an ace arrow shooter?");
if (Q5 === yes && Q6 === yes); {
console.log(" Great, you should be very accurate");
} else {
console.log(" Dont do it, you get yourself killed!");
}
break;
};

I have no idea whats wrong with the code, it says that there is a syntax error, but i can't find it


#4

it specifically says that there is an unexpected token else


#5

Where's your switch? I only see cases.


#6

Ohh, your right Alright i changed the code to look like this

switch(user)
var user = prompt("What kind of specialist are you?").toUpperCase();

var Q1 = prompt("Are you combat ready?")
var Q2 = prompt("Are you afraid of fire?").toUpperCase()
if (Q1 === yes && Q2 === no);{
console.log("You will be a great fire break");
} else {
console.log("I dont think fire break is for you.");
}
break;
case 'nomad':
var Q3 = prompt( "are you combat ready?").toUpperCase()
var Q4 = prompt("Do you like bees?").toUpperCase()
if(Q3 === yes && Q4 === yes); {
console.log("Have fun use bees to your advantage");
} else {
console.log("Dont be nomad, you get stung!");
}
break;
case 'sparrow':
var Q5 = prompt("Are you combat ready?");
var Q6 = prompt("Are you an ace arrow shooter?");
if (Q5 === yes && Q6 === yes); {
console.log(" Great, you should be very accurate");
} else {
console.log(" Dont do it, you get yourself killed!");
}
break;
};


#7

and it says unexpected token var


#8

case statements have to have an initial switch statement that they're checking. So you can't just call a case in the middle of nowhere if you want to check for the string 'nomad' I'd suggest just using an if statement seeing as it's more efficient for the way you have written your code.