Xadez

Animal type

Apr 14th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Learning {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. String pet = scanner.nextLine();
  8. pet = pet.toLowerCase();
  9. switch (pet) {
  10. case "dog":
  11. System.out.println("mammal");
  12. break;
  13. case "snake":
  14. case "crocodile":
  15. case "tortoise":
  16. System.out.println("reptile");
  17. break;
  18. default:
  19. System.out.println("unknown");
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment