fork download
  1. // usetime1.cpp -- using the second draft of the Time class
  2. // compile usetime1.cpp and mytime1.cpp together
  3. #include <iostream>
  4. #include "mytime1.h"
  5.  
  6. int main()
  7. {
  8. using std::cout;
  9. using std::endl;
  10. Time planning;
  11. Time coding(2, 40);
  12. Time fixing(5, 55);
  13. Time total;
  14.  
  15. cout << "planning time = ";
  16. planning.Show();
  17. cout << endl;
  18.  
  19. cout << "coding time = ";
  20. coding.Show();
  21. cout << endl;
  22.  
  23. cout << "fixing time = ";
  24. fixing.Show();
  25. cout << endl;
  26.  
  27. total = coding + fixing;
  28. // operator notation
  29. cout << "coding + fixing = ";
  30. total.Show();
  31. cout << endl;
  32.  
  33. Time morefixing(3, 28);
  34. cout << "more fixing time = ";
  35. morefixing.Show();
  36. cout << endl;
  37. total = morefixing.operator+(total);
  38. // function notation
  39. cout << "morefixing.operator+(total) = ";
  40. total.Show();
  41. cout << endl;
  42. // std::cin.get();
  43. return 0;
  44. }
  45.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:21: fatal error: mytime1.h: No such file or directory
compilation terminated.
stdout
Standard output is empty