Skip to main content

Practice · 1 of 2

Arithmetic and comparison for Money

CHALLENGE
Difficulty: intermediate+25 XP

Implement class Money (private long cents_;, explicit Money(long), long cents() const) and, as free functions, operator+, operator-, operator==, and operator< over Money.

Back to lesson: Practice: Operator overloading