/******************************************************************************************** datetest.cpp Testing the Date class ********************************************************************************************/ #include <iostream> using namespace std; #include "date.h" void paces(Date& D); void main() { //no arguments Date dTest; paces(dTest); //create using arguments Date dTest2(7,4,1776); //Jul. 4, 1776 paces(dTest2); cout << "Display the second in parts" << endl << "\tYear: " << dTest2.getYear() << endl << "\tMonth: " << dTest2.getMonth() << endl << "\tDay: " << dTest2.getDay() << endl << endl; cout << "Add the first to the second: "; cout << dTest + dTest2 << endl; } void paces(Date& D) { //putting the object through it's paces... cout << "Start: "; D.print(); cout << endl; int i; for (i = 0; i < 4; i++) { cout << "Add 25d: "; D.addDay(25); cout << D << endl; } D.setSeparator(','); for (i = 0; i < 4; i++) { cout << "Add 10m: "; D.addMonth(10); cout << D << endl; } D.setSeparator('\372'); for (i = 0; i < 4; i++) { cout << "Add 1y: "; D.addYear(1); cout << D << endl; } D.setSeparator('/'); cout << endl; }