Help me please
Create a program that prints the day number of the year, given the input date from the user in the form month-day-year.For example, if the input is 1-1-2006, the day number is 1; if the input is 12-25-2006, the day number is 359. The function should check for a leap year. A year is a leap year if it is divisible by 4, but not divisible by 100. For example, 1992 and 2008 are divisible by 4, but not by 100. A year that is divisible by 100 is a leap year if it is also divisible by 400. For example, 1600 and 2000 are divisible by 400. However, 1800 is not a leap year because 1800 is not divisible by 400.
u still here?
well this function will check whether the year is a leap year or not public void leapYearChecker (int year){ if (year%4==0 && year%400==0) System.out.println(" Leap year"); else if (year%4==0 && year%100!=0) System.out.println( "a leap year"); else if (year%100==0 ) System.out.println("not leap year"); else System.out.println("not a leap year"); } }
Join our real-time social learning platform and learn together with your friends!