/* This file contains the interface for class Temperature.

------------------------------------------------------------------*/

#ifndef TEMPERATURE
#define TEMPERATURE

#include <iostream.h>
#include "Boolean.h"

class Temperature
{
   double
      Degrees_;
   char
      Scale_;

public:

   /*********** Class Constructor **********************************

      Precondition:  A Temperature object has been declared
      Receive:       The (optional) initialization values
                       InitDegrees (a double, default 0.0)
                       InitScale (a char, default 'C')
      Postcondition: The declared Temperature object has its
                       Degrees_ member initialized to InitDegrees
                       and its Scale_ member initialized to
                       InitScale.
   ----------------------------------------------------------------*/

   Temperature(double InitDegrees = 0.0, char InitScale = 'C');


   /*********** Assignment *****************************************

      Receive: The Temperature object Temp being assigned
      Return:  The Temperature object containing this function,
                 its members as copies of those of Temp
   ----------------------------------------------------------------*/

   Temperature& operator=(const Temperature& Temp);


   /*********** Degrees Extraction *******************************

      Return:  The value stored in the Degrees_ member of the
                 Temperature object containing this function
   ----------------------------------------------------------------*/

   double Degrees(void) const { return Degrees_; };


   /*********** Scale Extraction **********************************

      Return:  The value stored in the Scale_ member of the
                 Temperature object containing this function
   ----------------------------------------------------------------*/

   char Scale(void) const { return Scale_; };


   /*********** Fahrenheit Conversion *******************************

      Return:  The Fahrenheit equivalent of the Temperature object
                 containing this function
   ----------------------------------------------------------------*/

   Temperature Fahrenheit(void) const;


   /*********** Celsius Conversion *********************************

      Return:  The Celsius equivalent of the Temperature object
                 containing this function
   ----------------------------------------------------------------*/

   Temperature Celsius(void) const;


   /*********** Output *****************************************

      Receive: An ostream Out, and a Temperature Temp
      Output:  A Temperature value (a double Degrees and char Scale)
      Return:  Out
   ----------------------------------------------------------------*/

   friend ostream& operator<<(ostream& Out, const Temperature& Temp);


   /*********** Input *****************************************

      Receive: An istream In, and a Temperature (reference) Temp
      Input:   A Temperature value (a double Degrees and char Scale)
      Return:  Temp, its members containing the input values
               In
   ----------------------------------------------------------------*/

   friend istream& operator>>(istream& In, Temperature& Temp);

   /********* Relational Operators *****************************/

   /**** Equality ****

      Receive: Temp1 and Temp2, two Temperature objects
      Return:  True if and only if corresponding data members of
                 Temp1 and Temp2 are the same
   -------------------------------------------------------------*/

   friend Boolean operator==(const Temperature& Temp1,
                             const Temperature& Temp2);

   /**** Inequality ****

      Receive: Temp1 and Temp2, two Temperature objects
      Return:  True if and only if at least one data member of
                 Temp1 is different from the corresponding data
                 member of Temp2
   -------------------------------------------------------------*/

   friend Boolean operator!=(const Temperature& Temp1,
                             const Temperature& Temp2);


   /**** Less than ****

      Receive: Temp1 and Temp2, two Temperature objects
      Return:  True if and only if the Degrees_ member of Temp1
                 is less than the Degrees) member of Temp2
                 (and their Scale_ members are equal)
   -------------------------------------------------------------*/

   friend Boolean operator<(const Temperature& Temp1,
                            const Temperature& Temp2);

   /**** Greater than ****

      Receive: Temp1 and Temp2, two Temperature objects
      Return:  True if and only if the Degrees_ member of Temp1
                 is greater than the Degrees) member of Temp2
                 (and their Scale_ members are equal)
   -------------------------------------------------------------*/

   friend Boolean operator>(const Temperature& Temp1,
                            const Temperature& Temp2);

   /**** Less than or equal to ****

      Receive: Temp1 and Temp2, two Temperature objects
      Return:  True if and only if the Degrees_ member of Temp1
                 is less than or equal to the Degrees) member of
                 Temp2 (and their Scale_ members are equal)
   -------------------------------------------------------------*/

   friend Boolean operator<=(const Temperature& Temp1,
                            const Temperature& Temp2);

   /**** Greater than or equal to ****

      Receive: Temp1 and Temp2, two Temperature objects
      Return:  True if and only if the Degrees_ member of Temp1
                 is greater than or equal to the Degrees) member
                 of Temp2 (and their Scale_ members are equal)
   -------------------------------------------------------------*/

   friend Boolean operator>=(const Temperature& Temp1,
                            const Temperature& Temp2);

};

#endif

