You assigned value in wrong way:
update:
triangle::triangle(float base, float height)
{
base=_base;
height=_height;
}
to:
triangle::triangle(float base, float height)
{
_base = base;
_height = height;
}
Edit:
Also as @WhozCraig mentions, should use float for 1/2, or just
_base * _height / 2.0