Advertisement
CyrusVerkest

Horoscope

Apr 1st, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.44 KB | None | 0 0
  1. import java.util.Random;
  2.  
  3.  
  4. public class Horoscope {
  5.     private int month;
  6.     private int day;
  7.    
  8.     String fortune[] = {"Your Lucky number is: 12", "Your Lucky number is 13", "Your Lucky number is 23", "Your Lucky number is 79", "Your Lucky number is 100"};
  9.     Random dice = new Random();
  10.     int n = dice.nextInt(6);
  11.     public Horoscope(int month, int day)
  12.     {
  13.         if(month == 3 && month > 21 && month <= 31)
  14.         {
  15.             System.out.println("Aries: " + fortune[n]);        
  16.         }      
  17.         if(month == 4 && month > 0 && month <= 19)
  18.         {
  19.             System.out.println("Aries: " + fortune[n]);        
  20.         }
  21.        
  22.         if(month == 4 && month > 19 && month <= 30)
  23.         {
  24.             System.out.println("Taurus: " + fortune[n]);           
  25.         }      
  26.         if(month == 5 && month > 0 && month <= 20)
  27.         {
  28.             System.out.println("Taurus: " + fortune[n]);           
  29.         }
  30.        
  31.         if(month == 5 && month > 20 && month <= 31)
  32.         {
  33.             System.out.println("Gemini: " + fortune[n]);           
  34.         }      
  35.         if(month == 6 && month > 0 && month <= 20)
  36.         {
  37.             System.out.println("Gemini: " + fortune[n]);           
  38.         }
  39.        
  40.         if(month == 6 && month > 20 && month <= 30)
  41.         {
  42.             System.out.println("Cancer: " + fortune[n]);           
  43.         }
  44.         if(month == 7 && month > 0 && month <= 22)
  45.         {
  46.             System.out.println("ACancer: " + fortune[n]);          
  47.         }
  48.        
  49.         if(month == 7 && month > 22 && month <= 31)
  50.         {
  51.             System.out.println("leo: " + fortune[n]);          
  52.         }
  53.         if(month == 8 && month > 0 && month <= 22)
  54.         {
  55.             System.out.println("Leo: " + fortune[n]);          
  56.         }
  57.        
  58.         if(month == 8 && month > 22 && month <= 31)
  59.         {
  60.             System.out.println("Virgo: " + fortune[n]);        
  61.         }
  62.         if(month == 9 && month > 0 && month <= 22)
  63.         {
  64.             System.out.println("Virgo: " + fortune[n]);        
  65.         }
  66.        
  67.         if(month == 9 && month > 22 && month <= 30)
  68.         {
  69.             System.out.println("Libra: " + fortune[n]);        
  70.         }
  71.         if(month == 10 && month > 0 && month <= 22)
  72.         {
  73.             System.out.println("Libra: " + fortune[n]);        
  74.         }
  75.        
  76.         if(month == 10 && month > 22 && month <= 31)
  77.         {
  78.             System.out.println("Scorpio: " + fortune[n]);          
  79.         }
  80.         if(month == 11 && month > 0 && month <= 21)
  81.         {
  82.             System.out.println("Scorpio: " + fortune[n]);          
  83.         }
  84.        
  85.         if(month == 11 && month > 21 && month <= 31)
  86.         {
  87.             System.out.println("Sagitarius: " + fortune[n]);           
  88.         }
  89.         if(month == 12 && month > 0 && month <= 21)
  90.         {
  91.             System.out.println("Sagitarius: " + fortune[n]);           
  92.         }
  93.        
  94.         if(month == 12 && month > 21 && month <= 31)
  95.         {
  96.             System.out.println("Capricorn: " + fortune[n]);        
  97.         }
  98.         if(month == 1 && month > 0 && month <= 19)
  99.         {
  100.             System.out.println("Capricorn: " + fortune[n]);        
  101.         }
  102.        
  103.         if(month == 1 && month > 19 && month <= 31)
  104.         {
  105.             System.out.println("Aquarius: " + fortune[n]);         
  106.         }
  107.         if(month == 2 && month > 0 && month <= 18)
  108.         {
  109.             System.out.println("Aquarius: " + fortune[n]);         
  110.         }
  111.        
  112.         if(month == 2 && month > 18 && month <= 28)
  113.         {
  114.             System.out.println("Pisces: " + fortune[n]);           
  115.         }
  116.         if(month == 3 && month > 0 && month <= 21)
  117.         {
  118.             System.out.println("Pisces: " + fortune[n]);           
  119.         }
  120.     }
  121. }
  122. --------------------------------------------------------------------------------------------------------------------------------
  123. import java.util.Scanner;
  124.  
  125.  
  126. public class Tester {
  127.  
  128.     public static void main(String[] args) {
  129.         Scanner in = new Scanner(System.in);
  130.         System.out.println("Enter you birth month (As a number)");
  131.         int n = in.nextInt();
  132.         System.out.println("Enter you birth day");
  133.         int b = in.nextInt();
  134.        
  135.         Horoscope horror = new Horoscope(n, b);
  136.        
  137.     }
  138.  
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement