/****************************************************************
example 7 -- length.cpp
    feet/inches manager
****************************************************************/
#include "length.h"

bool length::GrowByFeet = true;

length::length(const int& f, const int& i) {
    inches = 0;
    if (f > 0)
        inches += f*12;

    if (i > 0)
        inches += i;
}

void length::grow(const float& f) {
    if (GrowByFeet)
        inches += f * 12;
    else
        inches += f;
}

ostream& operator<<(ostream& out, const length& l) {
    l.show(out);
    return out;
}