dollars = $this->dollars + $other->dollars; $this->cents = $this->cents + $other->cents; while ($this->cents > 100) { $this->cents = $this->cents - 100; $this->dollars = $this->dollars + 1; } } function set($d, $c) { $this->dollars = $d; $this->cents = $c; } function __tostring() { return "\$$this->dollars.$this->cents"; } } ?>