| *** You may only submit a given problem once - no resubmissions will be accepted. ***
A no-zero number system uses only the digits 1 through 9. So counting begins with 1, the first
"counting number", and continues:
-
1,2,3,4,5,6,7,8,9,11,12,...,19,21,...,98,99,111,112,...
So, in this system 9 is the ninth counting number and 11 is the tenth counting number.
As usual, addition can be defined by reference to the counting sequence. Addition of the i-th counting number and the j-th counting number is defined to mean the (i+j)-th counting number. Thus, in this system
5 + 8 = 14, since 5 is the fifth counting number, 8 is the eighth, and 14 is the thirteenth counting number. Subtraction
is the reverse of addition. Create a class NoZero that contains the method subtract that
takes two no-zero numbers, big and small, and returns the no-zero value that results
from calculating big - small.
|