Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Problem Description: Design a class called Date . The class should store a date in three integers: month, day, and year. Create the necessary

C++

Problem Description:

Design a class called Date. The class should store a date in three integers: month, day, and year.

Create the necessary set and get methods.

Design member functions to return the date as a string in the following formats:

12/25/2012

December 25, 2012

25 December 2012

Input Validation:

Do not accept values for day greater than 30 or less than 1.

Do not accept values for month greater than 12 or less than 1.

Do not accept values for year greater than 2025 or less than 1900.

The second part is:

Problem 2:

Extend the Date Class that you created in the previous problem

Include the following methods:

Default Constructor: Initializes Date object to Jan 1, 1900

Parameterized Constructor

Copy Constructor

Destructor

static isValidYear predicate method: valid range: 1900 to current year.

static isValidMonth predicate method

static isValidDay predicate method for a given month

static isLeapYear predicate method

Implement a test program to demonstrate your class methods. Identify each test.

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