Question: Develop a class Date for representing a calendar. The class should provide a default constructor that initializes the date to January 1, 1900. Another constructor

Develop a class Date for representing a calendar. The class should provide a default constructor that initializes the date to January 1, 1900. Another constructor should initialize a Date object to a specific value using three integer parameters corresponding to the desired month, day and year. Define the function nextDate that returns the successive date, the new value of the Date object. You should take into account if a year is a leap year or not. For example, applying nextDate on the date 12-31-2020 provides a new date 01-01-2021. Also define the function ToString which returns a string version of a Date object. For example, applying ToString on the date 12-01-2020 returns December 1st, 2020. Write a driver program to test your class. A leap year is : divisible by 400 or divisible by 4 and not divisible by 100. Examples : 1600 is a leap year because 1600 is divisible by 400 1988 is a leap year because 1988 is divisible by 4 and not by 100.

c++

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!