- 2
Por que me sale error en el caso de prueba 5 en el ejercicio de las emociones
2 Answers
+ 1
Why I get an error in test case 5 in the exercise of emotions
please post your code and attempt so that we can help you.
0
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int emotion = scanner.nextInt();
/*
1 - "You are happy!"
2 - "You are sad!"
3 - "You are angry!"
4 - "You are surprised!"
other - "Unknown emotion."
*/
// tu cĂłdigo va aquĂ
switch (emotion){
case 1:
System.out.println("You are happy!");
break;
case 2:
System.out.println("You are sad!");
break;
case 3:
System.out.println("You are angry!");
break;
case 4:
System.out.println("You are surprised!");
default:
System.out.println("Unknown emotion.");
}
}
}