Example #1
0
/*********************  TestDigits   *************************************

   Allows testing of the member functions Digits and MaxDigits.

   This routine assumes that input and output functions for MyFloats
   have been written and debugged.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
void TestDigits()
{
  MyFloat X;

  cout <<"\n============ Testing Digits and MaxDigits  ==============\n\n";

  cout << "X.MaxDigits() = " << X.MaxDigits() << " \n\n";

  do
    {
    cout << "\nEnter MyFloat ==> ";
    cin >> X;
    cin.ignore(1000, '\n');         //  Discard all chars in input stream.
    cout << "\nDigits(" << X << ") = " << X.Digits() << endl;
    }
  while ( SpaceBarToContinue() );
}