Which proposed code change will result
in this code properly inserting commas?
Interchange the
line: writeThreeDigits(n%1000); with the
line: writeWithCommas(n/1000);.
- Change the line: writeWithCommas(n/1000);
to be writeWithCommas(n%1000);
- Change the test in writeWithCommas to
be if (n > 1000)
- Interchange the line:
System.out.print(n/100); with the
line: System.out.print(n%10);
in writeThreeDigits.
- Replace the line: writeThreeDigits(n%1000);
with the line: writeThreeDigits(n/1000);.
The problem is that the blocks of digits are put in
reverse order.