Advertisement
Samuella

Chinese Zodiac

May 11th, 2020
1,359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.06 KB | None | 0 0
  1. package com.company;
  2. import java.util.*;
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner input = new Scanner (System.in);
  6.         int remainder = input.nextInt() % 12;
  7.         String animal="";
  8.         switch (remainder)
  9.         {
  10.             case 0: animal = "Monkey";
  11.                 break;
  12.             case 1: animal = "Rooster";
  13.                 break;
  14.             case 2: animal = "Dog";
  15.                 break;
  16.             case 3: animal = "Pig";
  17.                 break;
  18.             case 4: animal = "Rat";
  19.                 break;
  20.             case 5: animal = "Ox";
  21.                 break;
  22.             case 6: animal = "Tiger";
  23.                 break;
  24.             case 7: animal = "Rabbit";
  25.                 break;
  26.             case 8: animal = "Dragon";
  27.                 break;
  28.             case 9: animal = "Snake";
  29.                 break;
  30.             case 10: animal = "Horse";
  31.                 break;
  32.             case 11: animal = "Ram";
  33.                 break;
  34.         }
  35.         System.out.println(animal);
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement