I’ve recently run into an issue where my tests are not running in any of the Java, beginning with the Selecting from Many Options with Switch Statements.
I am aware that the code sometimes won’t run if there are any errors in the reply. My answer is as follows:
function caseInSwitch(val) {
var answer = "";
// Only change code below this line
case 1:
answer = "alpha";
break;
case 2:
answer = "beta";
break;
case 3:
answer = "gamma";
break;
case 4:
answer = "delta";
break;
// Only change code above this line
return answer;
}
// Change this value to test
caseInSwitch(3);