YavorGrancharov

AnimalType

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