Question: My assignment is writing a program using 12 methods and here is the sample how the program should be run. Thank for any help or
1. public static boolean isLeapYear (int year) Returns whether or not the given year is a leap year. 2. public static int dayofYear(int month, int day, int year) -1 Return the day of the year. Return if the date is not valid. 3. public static int daysRemaining(int month, int day, int year) Return the number of days remaining in the year. Return-1 if the date is not valid. 4. public statie boolean isDatevalid (int month, int day, int year) Return whether or not the date given is valid. 5. public static short daysInMonth(int month, int year) if the month is Given a month number, return the number of days in that month for that year. Return not valid 0 6. public static void dateReport(int month, int day, int year) Print out a date report for the given date as shown in the sample runs. 7. public static short monthNaneTollumber (String month) Given a String of the full month January or the first three letters Jan . return the month's position in the year. For example. -jUL. would return 7 . Invalid months should return -1 , (case 8. public static String monthNumberToName (int month) Given a month of the year, return the full name of the month as a string or INVALID otherwise. 9. public static int daysBetween(int ml, int di, int yl, int m2, int d2, int y2) Return the number of days between two dates in the same year. If either of the dates are invalid or the years are not the same, return-1 10. pub1ic static long millisecLeftInear(int month, int day, int year) Return the number of milliseconds left in a year. You may assume 24-hour days and work in whole-day increments. 11. public static void printMenu () Print out the choice menu as shown in the sample runs. 12. public static int getPosNum( int max) Prompt the user to "Enter a positive number up to [max]:until a valid number is read in. See the sample runs for an example. If max is not a positive number, returno
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
