Question: For this class provide: a constructor: parameters for the constructor must be provided in the following order: month, day, and year. use the default values

For this class provide:
a constructor:
parameters for the constructor must be provided in the following order: month, day, and year.
use the default values technique so that if no data is provided for month, day, year the date is set to January 1,1900.
inspectors/getters/accessors for all the data members. Use the get convention to name your getters.
a mutator/setter changeDate:
this setter modifies the Date object by adding a given amount of days.
this setter takes one parameter which is an integer that represents the number of days to add to a Date object.
You must be careful and make sure the resulting Date remains in the valid range. For example if you add 2 days to 01/31/2024 the resulting date should be 02/02/2024; and if you add 15 to 12/31/2024 the resulting date should be 01/15/2025
Note: Remember that January, March, May, July, August, October and December have 31 days. Assume February has always 28 days. April, June, September, and November have 30 days.
Hint: You will need to use loops and if statements for this method. You are not allowed to use the datetime module or any other materials not specifically covered in cS 171/ CS 172.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!