#include #include "Date.hpp" // Function declaration int main(); // Function definition int main() { // Construct and display a date. Date today{ 2026, 10, 2 }; std::cout << "The date is " << today << "." << std::endl; // Query the components of a date. std::cout << "The year is " << today.year() << "." << std::endl; std::cout << "The month is " << today.month() << "." << std::endl; std::cout << "The day is " << today.day() << "." << std::endl; // Obtain a string representation of a date. std::cout << "As a string: " << today.to_string() << std::endl; // Demonstrate prefix and postfix increment. Date date{ 2026, 10, 31 }; std::cout << std::endl << "Starting date: " << date << std::endl; std::cout << "Prefix increment: " << ++date << std::endl; std::cout << "Postfix increment: " << date++ << std::endl; std::cout << "After increment: " << date << std::endl; // Demonstrate prefix and postfix decrement. std::cout << std::endl << "Prefix decrement: " << --date << std::endl; std::cout << "Postfix decrement: " << date-- << std::endl; std::cout << "After decrement: " << date << std::endl; // Demonstrate crossing a year boundary. Date new_year{ 2026, 12, 31 }; std::cout << std::endl << new_year << " is followed by "; ++new_year; std::cout << new_year << "." << std::endl; // Demonstrate a leap year. Date leap_year{ 2024, 2, 28 }; std::cout << leap_year << " is followed by "; ++leap_year; std::cout << leap_year << "." << std::endl; ++leap_year; std::cout << "The following date is " << leap_year << "." << std::endl; // Demonstrate the Julian-to-Gregorian transition. Date transition{ 1582, 10, 4 }; std::cout << std::endl << transition << " is followed by "; ++transition; std::cout << transition << "." << std::endl; std::cout << transition << " is preceded by "; --transition; std::cout << transition << "." << std::endl; return 0; }