Begin with the code are trying to convert. (Ie, put Java aside temporarily to make the problem more tractable). The aim is understand what the code is doing. Then you will have something specific...