/*****************************************************************************
 * FILE: tank.h                                                              *
 * CLASS PROVIDED: mixing_tank (part of namespace CS256_Asgn1)               *
 *                                                                           *
 * CONSTRUCTORS:                                                             *
 *   mixing_tank( )                                                          *
 *    Preconditions: none                                                    *
 *    Postconditions:  The tank has capacity 100 and is empty                *
 *                                                                           *
 *   mixing_tank( float capacity )                                           *
 *    Preconditions: capacity is non-negative                                *
 *    Postconditions: The tank has the specified capacity and is empty       *
 *                                                                           *
 * MODIFICATION MEMBER FUNCTIONS:                                            *
 *   void add_A( float quantity )                                            *
 *     Preconditions: quantity is non-negative                               *
 *                    quantity is no greater than remaining capacity         *
 *     Postconditions: quantity of liquid `A' has been added to tank         *
 *                                                                           *
 *   void add_B( float quantity )                                            *
 *     Preconditions: quantity is non-negative                               *
 *                    quantity is no greater than remaining capacity         *
 *     Postconditions: quantity of liquid `A' has been added to tank         *
 *                                                                           *
 *   float draw( float quantity );                                           *
 *     Preconditions: quantity is non-negative                               *
 *     Postconditions: if quantity is no greater than the current volume     *
 *                       then quantity of the mixed liquid has been removed  *
 *                       from the tank.  Otherwise the tank has been emptied *
 *                                                                           *
 * CONSTANT MEMBER FUNCTIONS:                                                *
 *   float get_volume( )                                                     *
 *     Preconditions: None                                                   *
 *     Postconditions: 0 <= return value <= capacity of tank                 *
 *                     Return value is volume of mixed liquid in tank        *
 *                                                                           *
 *   float get_space( )                                                      *
 *     Preconditions: None                                                   *
 *     Postconditions: 0 <= return value <= capacity of tank                 *
 *                     Return value is remaining capacity of tank            *
 *                                                                           *
 *   float get_mix( )                                                        *
 *     Preconditions: tank is not empty                                      *
 *     Postconditions: 0.0 <= return value <= 1.0                            *
 *                     Return value is proportion of A in tank               *
 *                                                                           *
 *   float is_empty( )                                                       *
 *     Preconditions: None                                                   *
 *     Postconditions: Returns true iff tank is empty                        *
 *                                                                           *
 * VALUE SEMANTICS                                                           *
 *  Assignments and copy constructor may be used with the mixing_tank class  *
 *  (via the automatic operators).                                           *
 *                                                                           *
 *****************************************************************************/
#ifndef CS256_tank
#define CS256_tank

namespace CS256_Asgn1
{

  class mixing_tank
    {
    public:
      // CONSTRUCTORS
      mixing_tank( );
      mixing_tank( float capacity );
      // MODIFICATION MEMBER FUNCTIONS
      void add_A( float quantity );
      void add_B( float quantity );
      float draw( float quantity );
      // CONSTANT MEMBER FUNCTIONS
      float get_space( ) const;
      float get_volume( ) const;
      float get_mix( ) const;
      float is_empty( ) const;
    private:
      // You must provide this part of the class declaration
    };

}

#endif

