Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class PA4b {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- System.out.println("Enter your birth month (1-12): ");
- int month = scanner.nextInt();
- if(month < 1 | month > 12)
- {
- System.out.println("Invalid month.");
- System.exit(0);
- }
- else
- {
- System.out.println("Enter your birth day (1-31): ");
- int day = scanner.nextInt();
- if(day < 1 | day > 31)
- {
- System.out.println("Invalid day.");
- System.exit(0);{
- }
- if(month == 3 && day >= 21 || month == 4 && day <= 19)
- {
- System.out.println("You are an Aries!");
- }
- else if(month == 4 && day >= 20 || month == 5 && day <= 20)
- {
- System.out.println("You are an Taurus!");
- }
- else if(month == 5 && day >= 21 || month == 6 && day <= 21)
- {
- System.out.println("You are an Gemini!");
- }
- else if(month == 6 && day >= 22 || month == 7 && day <= 22)
- {
- System.out.println("You are an Cancer!");
- }
- else if(month == 7 && day >= 23 || month == 8 && day <= 22)
- {
- System.out.println("You are an Leo!");
- }
- else if(month == 8 && day >= 23 || month == 9 && day <= 22)
- {
- System.out.println("You are an Virgo!");
- }
- else if(month == 9 && day >= 23 || month == 10 && day <= 22)
- {
- System.out.println("You are an Libra!");
- }
- else if(month == 10 && day >= 23 || month == 11 && day <= 21)
- {
- System.out.println("You are an Scorpio!");
- }
- else if(month == 11 && day >= 22 || month == 12 && day <= 21)
- {
- System.out.println("You are an Sagittarius!");
- }
- else if(month == 12 && day >= 22 || month == 1 && day <= 19)
- {
- System.out.println("You are an Capricorn!");
- }
- else if(month == 1 && day >= 20 || month == 2 && day <= 18)
- {
- System.out.println("You are an Aquarius!");
- }
- else if(month == 2 && day >= 19 || month == 3 && day <= 20)
- {
- System.out.println("You are an Pisces!");
- }
- System.out.println("Tony Stark will buy out your business.");
- System.exit(0);}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement