home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / EXAMPLES / EX0903.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-20  |  775 b   |  31 lines

  1. // \EXAMPLES\EX0903.CPP
  2.  
  3. //---------------------------------------------------------
  4. // files in this example:
  5. // %F,15,EX0900.H%EX0900.H      definition of Fraction class
  6. // %F,15,EX0900.CPP%EX0900.CPP    Fraction members & friends
  7. // EX0903.CPP    this file
  8. //---------------------------------------------------------
  9.  
  10. #include <iostream.h>
  11. #include "EX0900.H"
  12.  
  13. void main ()
  14. {
  15.    Fraction y(0.5);
  16.    cout << "The initial value of y is: ";
  17.    cout << y;
  18.  
  19.    cout << endl;
  20.    cout << "       The value of y is: ";
  21.    cout << y;
  22.    cout << "             The value of  -y  is: ";
  23.    cout << -y;
  24.  
  25.    cout << endl;
  26.    cout << "       The value of y is: ";
  27.    cout << y;
  28.    cout << "  The value of  y.operator-()  is: ";
  29.    cout << y.operator-();
  30. }
  31.