/* Tank.h Class definition for tanks Specification: Laboratory 2 notes Author: J Morri Date: Mar 25, 1998 */ #define TRUE 1 #define FALSE 0 /**** Name of the class ****/ typedef struct tank *Tank; /**** Methods for operating on the class ****/ /* Constructor */ Tank ConsTank( double height, double width, double depth ); /* Destructor */ void DestroyTank( Tank r ); /* Obtain the current dimensions */ double Height( Tank r ); double Length( Tank r ); double Depth( Tank r ); /* Obtain the current volume of liquid */ double CurVol( Tank t ); /* Obtain the space left for liquid */ double RemVol( Tank t ); /* Set the maximum safe capacity if cap < physical volume of tank, the set safe capacity to cap and return TRUE else return FALSE */ int SetSafeCap( Tank t, double cap ); /* Fill the tank if vol will fit in the tank, add vol to current volume and return TRUE else return FALSE */ int Fill( Tank t, double vol ); /* Drain the tank if there is at least vol in the tank, take vol out and return TRUE else return FALSE */ int Drain( Tank t, double vol );