completed calculator methods for TDD assignment