Advertisement
tchenkov

L04u10_AnimalType

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