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 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 creats 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:

3/15/13

March 15, 2013

15 March 2013

Demonstrate the class by writing a program that uses it. Be sure your program only accepts reasonable values for month and day. The month should be between 1-12. The day should be between 1 and the number in the selected month.

The Program must be in C++ and has to innclude leap years (every 4 years is feb-29) also must ask user to input month, day , and year in serpeate questions.

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!