Well, as far as converting the formula to one that Java understands:
denominator = ( 1 - R/100);
numerator = P * (1- ( power( R/100, n+1) ) );
total = numerator / denominator;
That assumes that you've got a function that'll do powers - but that's pretty simple to make (for positive powers only, especially).
As for reading the input, my memory of Java is kind of fuzzy, so unfortunately I can't help you with that part - but the formula itself doesn't seem like it'll be that tricky. I apologize if anything above is wrong, due to my bad memory. It's been a few years since I've messed with Java.
|