- 1
Hot to solve emotion detector
Java
4 Réponses
+ 6
You are spaces between 'are' and 'surprised'.
An Indeed, it's 'surprised', not 'suprised'😉
Copy to be sure
System.out.print("You are surprised!");
+ 3
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.");
}
}
}
+ 2
I think you just missed one 'r' letter in case 4, its "surprised" not "suprised".
Even something this simple can fail us in such tasks, the point is to be more thoroughly observant about what our code should output ...