Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: change long to int in compliant example as long was used inconsistently and is unnecessary.

...

This compliant solution uses an integer type (such as long int) and works with cents rather than dollars.

Code Block
bgColor#ccccff
longint dollar = 100;
longint dime = 10;
int number = 7;
System.out.println ("A dollar less " + number + " dimes is " +
		    (dollar - number * dime) + " cents" );

...