Programming is about decomposing large problems into smaller problems. You need to solve the small problems, then combine the small solutions into a solution to the larger problem.

What do the different variables and portions of the equation represent?

You should be able to create an "compounding" (or similarly named) variable to represent the solution to [tex](1+i)^n[/tex] then use it's value in both places it appears.

Once you have that, you should be able to calculate the "numerator" and "denominator" then go from there.

Good man James helped me learn die roll board game programming in Java,
and I applied it on Ladders and Snakes. Made one in Java. Now I'm learning to do ...