...
This compliant solution uses an integer type (such as long
int
) and works with cents rather than dollars.
Code Block | ||
---|---|---|
| ||
longint dollar = 100; longint dime = 10; int number = 7; System.out.println ("A dollar less " + number + " dimes is " + (dollar - number * dime) + " cents" ); |
...