ok try running this public static void main(String[] args) { enum Zodiac { ARIES(3, 21, 4, 19), TAURUS(4, 20, 5, 20), GEMINI(5, 21, 6, 20), CANCER(6, 21, 7, 22), LEO(7, 23, 8, 22), VIRGO(8, 23, 9, 22), LIBRA(9, 23, 10, 22), SCORPIO(10, 23, 11, 21), SAGITTARIUS(11, 22, 12, 21), CAPRICORN(12, 22, 1, 19), AQUARIUS(1, 20, 2, 18), PISCES(2, 19, 3, 20); private final int startMonth; private final int startDay; private final int endMonth; private final int endDay; Zodiac(int startMonth, int startDay, int endMonth, int endDay) { this.startMonth = startMonth; this.startDay = startDay; this.endMonth = endMonth; this.endDay = endDay; } public boolean isDateInRange(int day, int month) { if (startMonth < endMonth || (startMonth == endMonth && startDay <= endDay)) { return (month > startMonth || (month == startMonth && day >= startDay)) && (month < endMonth || (month == endMonth && day <= endDay)); } else { return (month > startMonth || (month == startMonth && day >= startDay)) || (month < endMonth || (month == endMonth && day <= endDay)); } } public static Zodiac fromDate(int day, int month) { for (Zodiac zodiac : values()) { if (zodiac.isDateInRange(day, month)) { return zodiac; } } throw new IllegalArgumentException("Invalid date"); } } LocalDate today = LocalDate.now(); int currentYear = today.getYear(); boolean isRunning = true; int year; boolean check = false; int month; int day; while (isRunning) { Scanner scanner = new Scanner(System.in); System.out.println("Please enter your birth date format like that \n XX \n YY \n MMMM "); day = scanner.nextInt(); month = scanner.nextInt(); year = scanner.nextInt(); if (day < 1 || day > 31) { System.out.println("Please Enter a valid day \n a day can't be smaller than 1 and bigger than 31"); System.out.println("Please enter your birth date format like that \n XX \n YY \n MMMM "); } if (month < 1 || month > 12) { System.out.println("Please Enter a valid month \n a month can't be smaller than 1 and bigger than 12"); System.out.println("Please enter your birth date format like that \n XX \n YY \n MMMM "); } if (year > currentYear) { System.out.println("Please Enter a valid year \n a year can't be bigger than current year"); System.out.println("Please enter your birth date format like that \n XX \n YY \n MMMM "); } System.out.println("Your zodiac sign is " + Zodiac.fromDate(day, month)); } }