Hi Ulf & Priety,
Thanks for the comments. I have taken note.
Below is my refined code:
The ouput iterates ten times, incrementing 'n' but keeping same value of 'a'.
Kindly help me understand how I can increment 'n' first, before 'a' is calculated based on the formula.
Also, is there a way I could use the output when 'n=1' as the value of P when 'n=2' and so on till year 10?
**Priety**..I understand the meaning of JavaRanch is '
NotACodeMill http://faq.javaranch.com/java/NotACodeMill' but I am trying to come up atleast with something as per what I know so far...
Thanks again for the time. It's appreciated