#include #include using namespace std; #include "CalendarItem.h" #include "Date.h" #include "Time.h" int main() { vector apptList; apptList.push_back( CalendarItem(Date(10,6,2014), Time(12,30), 60, "lunch meeting") ); apptList.push_back( CalendarItem(Date(10,6,2014), Time(17,00), 90, "soccer practice") ); apptList.push_back( CalendarItem(Date(10,7,2014), Time(14,30), 75, "cmsc 426") ); apptList.push_back( CalendarItem(Date(10,7,2014), Time(17,30), 75, "cmsc 426") ); apptList.push_back( CalendarItem(Date(10,10,2014), Time(23,30), 150, "movie premier") ); cout << endl; cout << "The size of apptList is " << apptList.size() << endl; cout << "The capacity of apptList is " << apptList.capacity() << endl; cout << endl; for (unsigned int i=0; i < apptList.size(); i++) { cout << apptList[i] << endl << endl; } cout << "Creating new event and checking for conflicts..." << endl << endl; CalendarItem newEvent(Date(10,7,2014), Time(17,00), 120, "happy hour"); for (unsigned int i = 0; i < apptList.size(); i++) if (newEvent.Conflict(apptList[i])) { cout << "Conflicting appointments!" << endl << endl; cout << newEvent << endl << endl; cout << apptList[i] << endl << endl; } cout << "Calling apptList.reserve(10)..." << endl; apptList.reserve(10); cout << endl; cout << "The size of apptList is " << apptList.size() << endl; cout << "The capacity of apptList is " << apptList.capacity() << endl; cout << endl; }