aneliabogeva

Animal Type

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