Advertisement
bstobbe

Horoscope

Sep 29th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.89 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Horoscope {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scan = new Scanner (System.in);
  7.        
  8.        
  9.         int month;
  10.         int day;
  11.         String monthDisplay = null;
  12.    
  13.         System.out.println("Please input your birthday to discover your horiscope");
  14.         System.out.println("Input your month and day as integers");
  15.        
  16.         month = scan.nextInt();
  17.         day = scan.nextInt();
  18.        
  19.         if (month == 1)
  20.         {
  21.             monthDisplay = ("January");
  22.         }
  23.        
  24.         if (month == 2)
  25.         {
  26.             monthDisplay = ("Febuary");
  27.         }
  28.        
  29.         if (month == 3)
  30.         {
  31.             monthDisplay = ("March");
  32.         }
  33.        
  34.         if (month == 4)
  35.         {
  36.             monthDisplay = ("April");
  37.         }
  38.        
  39.         if (month == 5)
  40.         {
  41.             monthDisplay = ("May");
  42.         }
  43.        
  44.         if (month == 6)
  45.         {
  46.             monthDisplay = ("June");
  47.         }
  48.        
  49.         if (month == 7)
  50.         {
  51.             monthDisplay = ("July");
  52.         }
  53.        
  54.         if (month == 8)
  55.         {
  56.             monthDisplay = ("August");
  57.         }
  58.        
  59.         if (month == 9)
  60.         {
  61.             monthDisplay = ("September");
  62.         }
  63.        
  64.         if (month == 10)
  65.         {
  66.             monthDisplay = ("October");
  67.         }
  68.        
  69.         if (month == 11)
  70.         {
  71.             monthDisplay = ("November");
  72.         }
  73.        
  74.         if (month == 12)
  75.         {
  76.             monthDisplay = ("December");
  77.         }
  78.        
  79.         if ((month < 1) || (month > 12) || (day < 1) || (day > 31))
  80.         {
  81.             System.out.println("Error");
  82.         }
  83.         else
  84.         {
  85.             System.out.println(day + " " + monthDisplay + "\n" );
  86.         }
  87.        
  88.    
  89.         if ((month < 1) || (month > 12) || (day < 1) || (day > 31))
  90.         {
  91.             System.out.println("");
  92.         }
  93.         else
  94.         {
  95.            
  96.        
  97.         if ((month == 1 && day <=31) ||  (month == 2 && day <= 18))
  98.         {
  99.             System.out.println("\n" + "Aquarius" );
  100.            
  101.         }
  102.         else if ((month == 2 && day >=19) ||  (month == 3 && day <= 20))
  103.         {
  104.             System.out.println("\n" + "Pisces" );
  105.         }
  106.         else if ((month == 3 && day >= 21) ||  (month == 4 && day <= 19))
  107.         {
  108.             System.out.println("\n" + "Aries" );
  109.         }
  110.         else if ((month == 4 && day >= 20) ||  (month == 5 && day <= 20))
  111.         {
  112.             System.out.println("\n" + "Taurus" );
  113.         }
  114.         else if ((month == 5 && day >= 21) ||  (month == 6 && day <= 20))
  115.         {
  116.             System.out.println("\n" + "Gemini" );
  117.         }
  118.         else if ((month == 6 && day >= 21) ||  (month == 7 && day <= 22))
  119.         {
  120.             System.out.println("\n" + "Cancer" );
  121.         }
  122.         else if ((month == 7 && day >= 22) ||  (month == 8 && day <= 22))
  123.         {
  124.             System.out.println("\n" + "Leo" );
  125.         }
  126.         else if ((month == 8 && day >= 23) ||  (month == 8 && day <= 22))
  127.         {
  128.             System.out.println("\n" + "Virgo" );
  129.         }
  130.         else if ((month == 9 && day >= 23) ||  (month == 10 && day <= 22))
  131.         {
  132.             System.out.println("\n" + "Libra" );
  133.         }
  134.         else if ((month == 10 && day >= 23) ||  (month == 11 && day <= 21))
  135.         {
  136.             System.out.println("Scorpio" );
  137.         }
  138.         else if ((month == 11 && day >= 22) ||  (month == 12 && day <= 23))
  139.         {
  140.             System.out.println("Sagittarius" );
  141.         }
  142.         else if ((month == 12 && day >= 23) ||  (month == 1 && day <= 19))
  143.         {
  144.             System.out.println("Capricorn" );
  145.         }
  146.        
  147.         }
  148.        
  149.  
  150.     }
  151.  
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement