1. Engineering
  2. Computer Science
  3. problem description design a class called date the class should...

Question: problem description design a class called date the class should...

Question details

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. Implement a test program to demonstrate your solution.

Problem Description:

  • Extend the Date Class that you created in Assignment 3

Include the following methods:

  1. Default Constructor: Initializes Date object to Jan 1, 1900
  2. Parameterized Constructor
  3. Copy Constructor
  4. Destructor
  5. static isValidYear predicate method:   valid range: 1900 to current year.
  6. static isValidMonth predicate method
  7. static isValidDay predicate method for a given month
  8. static isLeapYear predicate method
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution