Question: Design a class called Date that has data members to store month, day, and year. The class shoulds hav ea three-parameter default constructor that allows

 Design a class called Date that has data members to store

Design a class called Date that has data members to store month, day, and year. The class shoulds hav ea three-parameter default constructor that allows the date to be set at the time a new Date object is created. If the user creates a Date object without passing any arguments, or if any of the values passed a invalid, the default values of 1, 1, 2001 (i.e.., January 1, 2001) should be used. The class should have member functions to print the date in the following formats: Demonstrate the class by writing a program that uses it. program should only accept values between 1 and 12 for month, between 1 and 31 for the day, and between 1959 and 2020 for the year

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!