What is your Java version? Switch statements on strings only started in Java 7.
Else you will have to use the good old if condition :
String text = sc.next()
if(text.equals("abc")) {
output = 0;
} else if (text.equals("bcd")) {
output = 1;
}