#include #include #include "date.h" using namespace std; //Output the dates for the Spring 2026 CISC-2000-E01. int main() { const date a[] { //an array of 15 date objects { 1, 15, 2026}, //Call the constructor with three arguments. { 1, 22, 2026}, { 1, 29, 2026}, { 2, 5, 2026}, { 2, 12, 2026}, { 2, 19, 2026}, { 2, 26, 2026}, { 3, 5, 2026}, { 3, 19, 2026}, //No class 3/12/2026: Spring Break { 3, 26, 2026}, { 4, 9, 2026}, //No class 4/2/2026: Easter Recess { 4, 16, 2026}, { 4, 23, 2026}, { 4, 30, 2026}, { 5, 7, 2026} //Don't need comma. }; const size_t n {size(a)}; //the number of elements in the array //Loop through the array of objects with an int i for (int i {0}; i < n; ++i) { a[i].print(); //Call the print member func of the object a[i] cout << "\n"; } cout << "\n"; //Skip a line. //Loop through the array of objects with a pointer p for (const date *p {a}; p < a+n; ++p) { //a means &a[0]; a+n means &a[n] p->print(); //Call the print member function of the object ... cout << "\n"; //... that p points to. } cout << "\n"; //Skip a line. //Loop through the array of objects with a "range for loop". for (const auto& d: a) { //d is each object in the array, not a copy d.print(); cout << "\n"; } return EXIT_SUCCESS; }