Create a program that performs the following: Overview: Input values from the command line. Calculate the day of year from the inputs. Override Constructors: Use a switch statement based on the number of values input and call the correct constructor. If one value is input it is the year. Then the day and month are defaulted from today's monthday and month.
If two values are input it is the day and month. Then the year is defaulted from the current year. If three values are input, the values would be the month day, month and year. The following page will help you create the defaults in your constructors: http://www.roseindia.net/java/example/java/util/CurrentDate.shtml
Now you will have a class that has the day month and year. From the year, calculate if it is a leap year. That means that your class should have a method to calculate if the year is a leap year. See: http://www.go4expert.com/forums/showthread.php?t=2099 Now you will be able to calculate the number days that the input month, day and year represent. Testing:
January 1 will be day 1.
Feb 28 will always be day 59.
March 1 will be day 60 if it is not a leap year, day 61 if it is a leap year.
December 31 will be day 365 if it is not a leap year, day 366 if it is a leap year.