#include #include #include #include #include "Month.h" using namespace std; int main() { // Creating some months. // Coverage: constructors Month first; Month jan("Jan"); Month feb(2); Month bork(13); // Simple tests to see if the months seem valid. // Coverage: output functions first.outputMonthNumber(cout) << " "; first.output(cout) << endl; jan.outputMonthNumber(cout) << " "; jan.output(cout) << endl; feb.outputMonthNumber(cout) << " "; feb.output(cout) << endl; bork.outputMonthNumber(cout) << " "; bork.output(cout) << endl; // Testing accessors cout << "January's number is " << jan.getMonthNumber() << endl; cout << "February's number is " << feb.getMonthNumber() << endl; // Testing next(), next(num) and previous() Month newFeb = jan.next(); Month newJan = feb.previous(); Month newDec = jan.previous(); Month anotherJan = newDec.next(); Month newMar = jan.next(14); Month yetAnotherJan = feb.next(11); newFeb.output(cout << "February? ") << endl; newJan.output(cout << "January? ") << endl; newDec.output(cout << "December? ") << endl; anotherJan.output(cout << "January? ") << endl; yetAnotherJan.output(cout << "January? ") << endl; newMar.output(cout << "Next March? ") << endl; // Testing input() Month janToAug; janToAug.output(cout << "January: ") << endl; cout << "Enter 'Mar' as the month name: "; janToAug.input(cin); janToAug.output(cout << "March: ") << endl; system("pause"); return 0; }