/******************************************************************************************** ex6.cpp Developing the military time class ********************************************************************************************/ #include <iostream> using namespace std; #include "miltime.h" void paces(miltime& mt); void main() { //no arguments miltime mtTest; paces(mtTest); //create using arguments miltime mtTest2(3,15); //3:15 am paces(mtTest2); cout << "Add the first to the second: "; cout.flush(); mtTest2.addSame(mtTest); mtTest2.print(); cout << endl; cout << "Set a third equal to the sum of the first two: "; cout.flush(); miltime mtTest3 = mtTest2 + mtTest; mtTest3.print(); cout << endl; } void paces(miltime& mt) { //putting the object through it's paces... cout << "Start: "; cout.flush(); mt.print(); cout << endl; cout << "Add 45s: "; cout.flush(); mt.addSecond(45); mt.print(); cout << endl; cout << "Add 45s: "; cout.flush(); mt.addSecond(45); mt.print(); cout << endl; cout << "Add 45m: "; cout.flush(); mt.addMinute(45); mt.print(); cout << endl; cout << "Add 45m: "; cout.flush(); mt.addMinute(45); mt.print(); cout << endl; cout << "Add 45h: "; cout.flush(); mt.addHour(45); mt.print(); cout << endl << endl; }