Question: Create a C++ Date class that stores a calendar date. There should be a default constructor (taing no arguments) that initializes the Date object to

Create a C++ Date class that stores a calendar date.

There should be a default constructor (taing no arguments) that initializes the Date object to Jan 1, 2000.

A constructor taking three arguments (month, day, year) that initialeze the Date object to the parameter values:

It sets Dates year to 1900 if the year paameter is less than 1900

It sets the Dates month to 1 if the month is outside the range of i to 12

It sets the Dates day to 1 if the day parameter is outside the range of 1 to 12

How do i code this constructor?

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!