This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
This may not be the most efficient psuedo-code, but here's an approach
[code] change int to String add "000" in front of string get a substring of string.length-4 - string.length [code]
In the two minutes of thinking about it, this is the simplest approach I could come up with. There are several other ways - looping, and conditionals come to mind, but I think we'd all like to avoid control structures when possible.