Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class Horoscope {
- private int month;
- private int day;
- 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"};
- Random dice = new Random();
- int n = dice.nextInt(6);
- public Horoscope(int month, int day)
- {
- if(month == 3 && month > 21 && month <= 31)
- {
- System.out.println("Aries: " + fortune[n]);
- }
- if(month == 4 && month > 0 && month <= 19)
- {
- System.out.println("Aries: " + fortune[n]);
- }
- if(month == 4 && month > 19 && month <= 30)
- {
- System.out.println("Taurus: " + fortune[n]);
- }
- if(month == 5 && month > 0 && month <= 20)
- {
- System.out.println("Taurus: " + fortune[n]);
- }
- if(month == 5 && month > 20 && month <= 31)
- {
- System.out.println("Gemini: " + fortune[n]);
- }
- if(month == 6 && month > 0 && month <= 20)
- {
- System.out.println("Gemini: " + fortune[n]);
- }
- if(month == 6 && month > 20 && month <= 30)
- {
- System.out.println("Cancer: " + fortune[n]);
- }
- if(month == 7 && month > 0 && month <= 22)
- {
- System.out.println("ACancer: " + fortune[n]);
- }
- if(month == 7 && month > 22 && month <= 31)
- {
- System.out.println("leo: " + fortune[n]);
- }
- if(month == 8 && month > 0 && month <= 22)
- {
- System.out.println("Leo: " + fortune[n]);
- }
- if(month == 8 && month > 22 && month <= 31)
- {
- System.out.println("Virgo: " + fortune[n]);
- }
- if(month == 9 && month > 0 && month <= 22)
- {
- System.out.println("Virgo: " + fortune[n]);
- }
- if(month == 9 && month > 22 && month <= 30)
- {
- System.out.println("Libra: " + fortune[n]);
- }
- if(month == 10 && month > 0 && month <= 22)
- {
- System.out.println("Libra: " + fortune[n]);
- }
- if(month == 10 && month > 22 && month <= 31)
- {
- System.out.println("Scorpio: " + fortune[n]);
- }
- if(month == 11 && month > 0 && month <= 21)
- {
- System.out.println("Scorpio: " + fortune[n]);
- }
- if(month == 11 && month > 21 && month <= 31)
- {
- System.out.println("Sagitarius: " + fortune[n]);
- }
- if(month == 12 && month > 0 && month <= 21)
- {
- System.out.println("Sagitarius: " + fortune[n]);
- }
- if(month == 12 && month > 21 && month <= 31)
- {
- System.out.println("Capricorn: " + fortune[n]);
- }
- if(month == 1 && month > 0 && month <= 19)
- {
- System.out.println("Capricorn: " + fortune[n]);
- }
- if(month == 1 && month > 19 && month <= 31)
- {
- System.out.println("Aquarius: " + fortune[n]);
- }
- if(month == 2 && month > 0 && month <= 18)
- {
- System.out.println("Aquarius: " + fortune[n]);
- }
- if(month == 2 && month > 18 && month <= 28)
- {
- System.out.println("Pisces: " + fortune[n]);
- }
- if(month == 3 && month > 0 && month <= 21)
- {
- System.out.println("Pisces: " + fortune[n]);
- }
- }
- }
- --------------------------------------------------------------------------------------------------------------------------------
- import java.util.Scanner;
- public class Tester {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- System.out.println("Enter you birth month (As a number)");
- int n = in.nextInt();
- System.out.println("Enter you birth day");
- int b = in.nextInt();
- Horoscope horror = new Horoscope(n, b);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement