1
0

usetime3.cpp 612 B

1234567891011121314151617181920212223
  1. //usetime3.cpp -- using the fourth draft of the Time class
  2. // compile usetime3.cpp and mytime3.cpp together
  3. #include <iostream>
  4. #include "mytime3.h"
  5. int main()
  6. {
  7. using std::cout;
  8. using std::endl;
  9. Time aida(3, 35);
  10. Time tosca(2, 48);
  11. Time temp;
  12. cout << "Aida and Tosca:\n";
  13. cout << aida<<"; " << tosca << endl;
  14. temp = aida + tosca; // operator+()
  15. cout << "Aida + Tosca: " << temp << endl;
  16. temp = aida* 1.17; // member operator*()
  17. cout << "Aida * 1.17: " << temp << endl;
  18. cout << "10.0 * Tosca: " << 10.0 * tosca << endl;
  19. // std::cin.get();
  20. return 0;
  21. }