home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / FZNUM.ZIP / fuzzy / confint / test.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-03  |  2.4 KB  |  62 lines

  1. #include "confint.h"
  2.  
  3. int main()
  4.  
  5. {
  6.    float fValue1;
  7.    float fValue2;
  8.  
  9.    cout << "\n\n\tConfidence interval type test\n"
  10.       << "\nFirst interval: lower bound = ";
  11.    cin >> fValue1;
  12.    cout << "First interval: upper bound = ";
  13.    cin >> fValue2;
  14.    ConfInt ciItem1( fValue1, fValue2);
  15.    cout << "\nSecond interval: lower boud = ";
  16.    cin >> fValue1;
  17.    cout << "Second interval: upper bound = ";
  18.    cin >> fValue2;
  19.    ConfInt ciItem2( fValue1, fValue2);
  20.    cout << "\nSingleton value = ";
  21.    cin >> fValue1;
  22.  
  23.    cout << "\nFirst interval = " << ciItem1
  24.       << "\nSecond interval = " << ciItem2;
  25.  
  26.    cout << "\n+" << ciItem1 << " = " << +ciItem1
  27.       << "\n-" << ciItem1 << " = " << -ciItem1;
  28.  
  29.    cout << "\n" << ciItem1 << "+" << fValue1 << " = " << ( ciItem1 + fValue1)
  30.       << "\n" << fValue1 << "+" << ciItem1 << " = " << ( fValue1 + ciItem1)
  31.       << "\n" << ciItem1 << "+" << ciItem2 << " = " << ( ciItem1 + ciItem2);
  32.  
  33.    cout << "\n" << ciItem1 << "-" << fValue1 << " = " << ( ciItem1 - fValue1)
  34.       << "\n" << fValue1 << "-" << ciItem1 << " = " << ( fValue1 - ciItem1)
  35.       << "\n" << ciItem1 << "-" << ciItem2 << " = " << ( ciItem1 - ciItem2);
  36.  
  37.    cout << "\n" << ciItem1 << "*" << fValue1 << " = " << ( ciItem1 * fValue1)
  38.       << "\n" << fValue1 << "*" << ciItem1 << " = " << ( fValue1 * ciItem1)
  39.       << "\n" << ciItem1 << "*" << ciItem2 << " = " << ( ciItem1 * ciItem2);
  40.  
  41.    cout << "\n" << ciItem1 << "/" << fValue1 << " = " << ( ciItem1 / fValue1)
  42.       << "\n" << fValue1 << "/" << ciItem1 << " = " << ( fValue1 / ciItem1)
  43.       << "\n" << ciItem1 << "/" << ciItem2 << " = " << ( ciItem1 / ciItem2);
  44.  
  45.    cout << "\n" << ciItem1 << "+=" << fValue1 << " = " << ( ciItem1 += fValue1)
  46.       << "\n" << ciItem1 << "-=" << fValue1 << " = " << ( ciItem1 -= fValue1)
  47.       << "\n" << ciItem1 << "+=" << ciItem2 << " = " << ( ciItem1 += ciItem2)
  48.       << "\n" << ciItem1 << "-=" << ciItem2 << " = " << ( ciItem1 -= ciItem2)
  49.       << "\n" << ciItem1 << "*=" << fValue1 << " = " << ( ciItem1 *= fValue1)
  50.       << "\n" << ciItem1 << "/=" << fValue1 << " = " << ( ciItem1 /= fValue1)
  51.       << "\n" << ciItem1 << "*=" << ciItem2 << " = " << ( ciItem1 *= ciItem2)
  52.       << "\n" << ciItem1 << "/=" << ciItem2 << " = " << ( ciItem1 /= ciItem2);
  53.  
  54.    cout << "\nmin( " << ciItem1 << ", " << ciItem2 << ") = " << min( ciItem1, ciItem2)
  55.       << "\nmax( " << ciItem1 << ", " << ciItem2 << ") = " << max( ciItem1, ciItem2);
  56.  
  57.    cout << "\n";
  58.  
  59.    return 0;
  60. }
  61.  
  62.