Question: Design a class called Date that has integer data members to store month, day, and year. The class should have a three-parameter default constructor that

Design a class called Date that has integer data members to store month, day, and year. The class should have a 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 are invalid, the default values of 1, 1, 2000 (i.e., January 1, 2000) should be used. The class should have member functions to print the date in the following formats: 3/15/19 March 15, 2019 15 March 2019 The class should have a header file (Date.h) and a specification file (Date.cpp). Your main function should be in its own.cpp file. Demonstrate the class by writing a program that uses it. Be sure that your program accepts only reasonable values for month, day, and year. The month should be between 1 and 12, The day should be between 1 and the number of days in the selected month (use 29 for February). The year should be between 1900 and 2099. Show what happens when an invalid day, an invalid month, and an invalid year are entered
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
