Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import static java.lang.System.*;
- import java.util.Random;
- import java.util.Scanner;
- import java.lang.Math;
- class Main{
- public static void main (String str[]) throws IOException {
- Scanner scan = new Scanner(System.in);
- String[] months = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
- int month;
- int day;
- String[] days = {"first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth", "eleventh", "twelfth", "thirteenth", "fourteenth", "fifteenth", "sixteenth", "seventeenth", "eighteenth", "ninteenth", "twentieth", "twenty-first", "twenty-second", "twenty-third", "twenty-fourth", "twenty-fifth", "twenty-sixth", "twenty-seventh", "twenty-eighth", "twenty-ninth", "thirtieth", "thirty-first"};
- System.out.println("On what day of the month were your born? (number)");
- day = scan.nextInt();
- System.out.println("In which month were you born? (number)");
- month = scan.nextInt();
- if (day > 31 || day <= 0)
- {
- System.out.println("error");
- }
- else if (month >12 || month <= 0)
- {
- System.out.println("error");
- }
- else if ((month == 3 && day >= 21) || (month == 4 && day <= 19))
- {
- System.out.println("Your sign is Aries");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 4 && day >= 20) || (month == 5 && day <= 20))
- {
- System.out.println("Your sign is Taurus");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 5 && day >= 21) || (month == 6 && day <= 20))
- {
- System.out.println("Your sign is Gemini");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 6 && day >= 21) || (month == 7 && day <= 22))
- {
- System.out.println("Your sign is Cancer");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 7 && day >= 23) || (month == 8 && day <= 22))
- {
- System.out.println("Your sign is Leo");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 8 && day >= 23) || (month == 9 && day <= 22))
- {
- System.out.println("Your sign is Virgo");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 9 && day >= 23) || (month == 10 && day <= 22))
- {
- System.out.println("Your sign is Libra");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 10 && day >= 23) || (month == 11 && day <= 21))
- {
- System.out.println("Your sign is Scorpio");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 11 && day >= 22) || (month == 12 && day <= 21))
- {
- System.out.println("Your sign is Sagittarius");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 12 && day >= 22) || (month == 1 && day <= 19))
- {
- System.out.println("Your sign is Capricorn");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 1 && day >= 20) || (month == 2 && day <= 18))
- {
- System.out.println("Your sign is Aquarius");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- else if ((month == 2 && day >= 19) || (month == 3 && day <= 20))
- {
- System.out.println("Your sign is Pisces");
- System.out.println("Your birthday is: " + months[month-1] + " " + days[day-1]);
- System.out.println("Horoscope: Your fantastic!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement