public:
static const double absError=0.0000001;
static bool IsEqual(double a, double b)
{
if (a==b)
return true;
if (fabs(a-b)<absError)
return true;
return false;
}
/**重载赋值运算符后 交换两个类的数据**/
void swap(Distance& d){
Distance temp;
temp=*this;
*this=d;
d=temp;
}
/*** overloaded < operator 重载小于号 ***/
bool operator <(const Distance& d)
{
if((feet - d.feet<absError)||(feet == d.feet && inches - d.inches<absError))
{
return true;
}
return false;
}
/*** overloaded > operator 重载大于号***/
bool operator > (const Distance& d)
{
if((feet -d.feet>absError)||(feet == d.feet && inches - d.inc