Java - Extended Date Class

The project for this course is the creation of an ExtendedDate class.
Note that this definition of the Date class will permit saving any values for a date’s instance variables including zero or negative values, values for month greater than 12, values for day greater than 31, and no limits for the values of year.
Define a new class named ExtendedDate that inherits from or extends the Date class. This new class should provide the following additional capability.
The class should ensure that only ExtendedDate objects with valid dates are created. For example, month should always be between 1 and 12. Day should be between 1 and 31. The maximum value of day depends on the month for the date. The maximum day for the month of February also depends on the year value for the ExtendedDate object (i.e. is it a leap year or not?). The value of year should be between 1900 and 2999 (we won’t worry about dates before or after that date).
Once created, the values of an ExtendedDate object can be modified individually. For example, an ExtendedDate’s month, day, or year could be changed. However, we must sure that the result of any changes will not result in invalid dates being created. If it would, do not change the ExtendedDate object receiving the message.
In addition, ExtendedDate objects should have additional capabilities. Specifically, ExtendedDate should provide the methods listed under the Main Elements section below.
Objectives
To successfully complete this project, you will be expected to apply what you have learned in this course and should include several of the following course and module objectives:
1. Apply object-oriented principles to practice
2. Select environment specific classes best suited to developing an application
3. Design necessary classes consistent with the requirements of an application
4. Implement the principles of inheritance and polymorphism in designing object-oriented applications
5. Evaluate design alternatives in a multi-tier architecture
Main Elements
Your ExtendedDate object should provide:
Method Method Signature/Statement
A default constructor public class ExtendedDate extends Date {
// Default constructor
// Data members are set according to super defaults
A constructor that accepts parameters // Constructor that accepts parameters
public ExtendedDate(int month, int day, int year) {
}
A method to set the date the overrides the inherited setDate method // Method to set the date – override inherited setDate
method
// If data is invalid, do not change the receiver
public void setDate(int monthInt, int dayInt, int yearInt) {
}
A method to set the month ensuring that only valid changes are made // Method to set month ensuring that only valid changes are made
public void setMonth(int anInt) {
}
A method to set the day ensuring that only valid changes are made // Method to set day ensuring that only valid changes are made
public void setDay(int anInt) {
}
A method to set the year ensuring that only valid changes are made // Method to set year ensuring that only valid changes are made
public void setYear(int anInt) {
}
A method to verify that month, day, and year variables constitute a legitimate date // New method to verify a date
// Valid range is 1-1-1900 through 12-31-2999
public static boolean isValidDate(int month, int day, int year) {
return true;
}
A method to test to see if a year value is a leap year // Method to test for a leap year
public static boolean isLeapYear(int aYear) {
return true;
}
A method to see if an ExtendedDate object is in a leap year // Instance method version of the above
public boolean isLeapYear() {
return true;
}
A method to return the number of days in the month for an ExtendedDate object // Return number of days in a month
public int daysInMonth() {
return 0;
}
A method to return the number of days passed in a year for an ExtendedDate object // Return number of days passed in year (includes current day)
public int daysToDate() {
return 0;
}
A method to return the number of days remaining in a year for an ExtendedDate object // Return number of days remaining in year
public int daysRemainingInYear() {
return 0;
}
A method to create a new ExtendedDate object by adding a number of days to an existing ExtendedDate object
// Create a new ExtendedDate object with the values that result from adding a number of days to an existing ExtendedDate object. Cannot result in an invalid ExtendedDate being created. If an invalid date would be created, return a ExtendedDate with default values.
public ExtendedDate futureDate(int inDay) {
return new ExtendedDate();
}
}
Please note that the methods listed above state the ExtendedDate class’s public interface. It is essential that everyone use the same method signatures when creating the ExtendedDate class.
We want to be able to test the ExtendedDate class to be sure that it properly implements its requirements. To do so, create a separate class in the same package named TestExtendedDate. Create a main() method in this class that provides tests for the methods of the ExtendedDate class. - See more at: http://www.cramshark.com/assignment/207/Java-ExtendedDate#sthash.qHeByNse.dpufAttachments

ExtendedDate being created. If an invalid date would be created, return a ExtendedDate with default values.
public ExtendedDate futureDate(int inDay) {
//create new date based on current date
ExtendedDate d = new ExtendedDate(super.getMonth(), super.getDay(), super.getYear());
int daysRemaining = inDay;
//loop until all days are