Expand|Select|Wrap|Line Numbers
- public class Date
- {
- private int dMonth;
- private int dDay;
- private in dYear;
- public Date()
- {
- dMonth = 1;
- dDay = 1 ;
- dYear = 1900;
- }
- public Date(int month, int day, int year)
- {
- dMonth = month;
- dDay = day;
- dYear = year;
- }
- public void setDate(int month, int day, int year)
- {
- dMonth = month;
- dDay = day;
- dYear = year;
- }
- public int getMonth()
- {
- return dMonth;
- }
- public int getDay()
- {
- return dDay;
- }
- public int getYear()
- {
- return dYear;
- }
- public String toString()
- {
- return (dMonth + "-" + dDay + "-" + dYear);
- }
- }
-Set the Month
-Set the Day
-Set the Year
-Return the Month
-Return the Day
-Return the Year
-Test whether the year is a leap year
-Return the number of days in the month. For example, if the date is 3-12-2005, the number of days to be returned is 31 because there are 31 days in March.
-Return the number of days passed in the year. For example if the date is 3-18-2005, the number of days passed in the year is 77. Note that the number of days returned also includes the current day.
-Return the number of days remaining in the year. For example, if the date is 3-18-2005, the number of days remaining in the year is 288.
-Calculate the new date by adding a fixed number of days to the date. For example, if the date is 3-18-2005 and the days to be added are 25, the new date is 4-12-2005.
-Return a reference to the object containing a copy of the date.
-Make a copy of another date. Given a reference to an object containing a date, copy the data members of the object into the corresponding data members of this object.
-Write the definitions of the methods to implement the operations defined for the class Date.
Please if anyone can help that would be amazing!?!