I'm having difficulty with this piece of work that I have been given. Would someone be kind enough to help me out or to do it for me or something as I have no idea. Here it is:
Create a Class named Year that contains a data field that holds the number of days in the year. Include a get method that displays the number of days and a constructor that sets the number of days to 365. Create the subclass named LeapYear. LeapYear?s constructor overrides Year?s constructor and sets the day field to 366. Write a program that instantiates one object of each class and displays each class? data.
Add a method named daysElapsed() to the Year class you created earlier. The daysElapsed() method accepts two arguments representing a month and a day; it returns an integer indicating the number of days that have elapsed since January 1 of the year. Create a daysElapsed() method for the LeapYear class that overrides the method in the Year class. Write a program that calculates the days elapsed on March 1 for a Year and for a LeapYear.
If anyone could please help me before the end of this week I would be very grateful.