I have made a little test program to show the user what bonus they get from having a certain value. The case statements should function as an OR gate. But the problem shows up when the alert should show up on screen but does not.
I have changing a few values, but that did not work. Also new to using JavaScript so I do not know what I can do as of right now.
var strength = prompt("What is the value of strength?");
switch (strength) {
case 10 :
case 11 :
alert("+0");
break;
case 12 :
case 13 :
alert("+1");
break;
case 14 :
case 15 :
alert("+2");
break;
case 16 :
case 17 :
alert("+3");
break;
case 18 :
case 19 :
alert("+4");
break;
case 20 :
case 21 :
alert("+5");
break;
default : ("Please enter a value between 10 and 20");
}
When the user enters the value of strength the bonus of that value should be showing up.
Example: strength = 12 alert("+1")
The alert does not show up though