Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions