0
Hie can i ask what is wrong with my code
import java.util.Scanner; 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." */ switch(emotion){ case 1: System.out.print("You are happy!"); break; case 2: System.out.print("You are sad!"); break; case 3: System.out.print("You are angry!"); break; case 4: System.out.print("You are suprised!"); break; default: System.out.print("Unknown emotion."); } } }
4 Answers
+ 7
Maposa Lyson There is nothing wrong in the syntax , your code runs well
+ 1
code is ok, but there is a typo in "surprised"
0
Can someone help me
0
Ok thank you let me correct it