Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Design a class called Date. The class should store a date in three integers: mon

ID: 3535598 • Letter: D

Question

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

Create a member function to display the date in the following format: December 25, 2005

Create both a default constructor and an overloaded constructor. The default one should initialize the date to January 1, 2000, and the overloaded one should take arguments for the month, day, and year.

Create accessors and mutators (gets and sets) for the member variables.

Overload the prefix and postfix ++ operators to increment the date. When a date is set to the last day of the month and incremented, it should become the first day of the following month. If the date is December 31, the incremented date should become January 1 of the following year.

Overload the prefix and postfix -- operators to decrement the date. When a date is set to the first day of the month, and decremented, it should become the last day of the previous month. If the date is January 1, the decremented date should become December 31 of the previous year.

Overload the stream insertion operator (<<) to display the date in the format: December 25, 2005.

Overload the stream extraction operator (>>) to prompt the user for a date to be stored.

Design a class called FutureDate that is derived from the Date class you have created. This class should not allow the user to store a date earlier than today's date. If the user enters a date earlier than today, display a message and let the user re-enter the date.

Create only one constructor, an overloaded constructor that accepts values for the month, day, and year, in that order, and initializes the object to that date. The constructor should prompt the user if the date is before today's date.

The decrement operators (prefix and postfix) should be overridden. Do not allow the date to be decremented so it is before today's date. Just keep the current date if decrementing it would put it in the past.

The following code snippet displays today's date.

Demonstrate the classes by using the chapter13_15.cpp driver program, located under content in Florida Online. This file should not need to be modified except where commented. If your classes don't work with the driver, modify your classes to work with it.

Input Validation: Do not accept values for the day greater than the number of days in the current month, or less than 1. Do not accept values for the month outside of the values 1-12.

Explanation / Answer

#include #include using namespace std; class Date { int month; int day; int year; public: void display() { switch(month) { case 1: cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote