borkins

10. Animal Type

Mar 26th, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. /**
  2.  * Project: Complex_Conditions - created by borkins on 2017-03-26.
  3.  */
  4.  
  5. import java.util.Scanner;
  6.  
  7. public class _10_AnimalType
  8. {
  9.     public static void main(String[] args)
  10.     {
  11.         Scanner console = new Scanner(System.in);
  12.        
  13.         String animal = console.nextLine().toLowerCase();
  14.        
  15.         switch (animal)
  16.         {
  17.             case "dog":
  18.                 System.out.println("mammal");
  19.                 break;
  20.             case "crocodile":
  21.             case "tortoise":
  22.             case "snake":
  23.                 System.out.println("reptile");
  24.                 break;
  25.             default:
  26.                 System.out.println("unknown");
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment