next up previous contents
Next: The Constructors: Up: Implementing the FLOAT_POLY_CELL Methods: Previous: Implementing the FLOAT_POLY_CELL Methods:

The Print/Grab Methods:

    // ********************************************************* //
    // const print function for FLOAT_POLY_CELL                  //
    // ********************************************************* //
ostream& FLOAT_POLY_CELL::print(ostream& output) const
{
  if(this!=NULL){
    output << "(" << element << ")";
    if(power == 0)
      output << " ";
    else if (power == 1)
      output << " x";
    else
      output << " x^" << power;
    if(next!=NULL)
      output << "+";
    else
      output << ".";
    return(output);
    }
  else{
    cout << "CELL is NULL " << endl;
    return(output);
    }
}

    // ********************************************************* //
    // grab function for FLOAT_POLY_CELL                         //
    // ********************************************************* //
istream& FLOAT_POLY_CELL::grab(istream& in)
{  
  in >> element;
  in >> power;
  return(in);
}



Jim Peterson
1999-04-22