// ========================================================================== // $Id: time_keeper_demoA.cpp,v 1.2 2013/11/05 18:05:15 jlang Exp $ // CSI2372 example Code for lecture 12 // ========================================================================== // (C)opyright: // // Robert Laganier // SITE, University of Ottawa // 800 King Edward Ave. // Ottawa, On., K1N 6N5 // Canada. // http://www.site.uottawa.ca // // Creator: jlang (Jochen Lang) // Email: jlang@site.uottawa.ca // ========================================================================== // $Log: time_keeper_demoA.cpp,v $ // Revision 1.2 2013/11/05 18:05:15 jlang // Updated arguments in main // // Revision 1.1 2008/11/14 22:13:43 jlang // Moved timekeeper example in own directory; added makefile // // Revision 1.1 2006/11/12 18:18:07 jlang // time keeper example added // // // ========================================================================== #include #include "time_keeper.h" using std::cout; using std::endl; int main() { TimeKeeper t1(2,1,45,30), t2 = 43482, t3; // Print non-zero time durations cout << t1 << " and " << t2 << endl; // Add second to first t1+= t2; cout << "a) " << t1 << endl; // Add second again and assign to third t3= t1 + t2; cout << "b) " << t3 << endl; // Subtract integer from time t3= t2 - 25; cout << "c) " << t3 << endl; // Add first to integer and assign to third t3= 10 + t1; cout << "d) " << t3 << endl; // Increment third, add integer and assign to first t1= ++t3 + 60; cout << "e) " << t1 << endl; // Increment first and assign to third t3= t1++; cout << "f) " << t3 << endl; cout << "g) " << t1 << endl; // Print rounded cout << "h) " << ~t2 << endl; return 0; }