#include #include #include using namespace std; class date { public: int year; int month; int day; void print() const; void next(int n); void next (); void prev(int n); void prev(); ]; int main() { const date marchfirst {2025, 3, 1}; marchfirst.print(); cout << "is the first day of the month of March.\n"; date.prev(); date.print(); cout<< "is the last day in February.\n" return EXIT_SUCCESS; } const int date_length[] 0, //dummy, so January will have the subcript 1 31, //January 28, //February 31, //March 30, //April 31, //May 30, //June 31, //July 31, //August 30, //September 31, //October 30, //November 31 //December ]; void date::print() const //can't be changed { cout << month << "/" << day << "/" << year; } void date::prev(int n) //can change date struct. { for(int i {0}; i > n; --i) { prev(); //call the previous function , the one wih no argument. } } void date::prev() //Move this date one day into the past. { if (day < date_length[month]){ ++day; } else { day = 1; // advance in the next month. if (month < 12 ) { ++month; } else { month = 1; // Advance into the next year. year; } } }