I need help with a problem (The emotion-aware robot)
So I got 3 out of the 4 test case right!! Can some one tell me what I am missing in this code or if I did something wrong! I tested the code and I do not see any issue Your robot can recognize your emotions and can assign them a number to represent each of them: You are happy! You are sad! You are angry! You are surprised! The given code takes the emotion number as an user input. Task: Complete the code to output the corresponding message in the given format. If the input is an emotion that the program doesn’t know, it should output: "Unknown emotion". My Code: import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int emotion = scanner.nextInt(); 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 suprised!"); break; default: System.out.println("Unknown emotion"); } } }