for (int year = 1; year <= 10; year++){
amount = principal * Math.pow(1+rate, year);
principal = amount;
System.out.printf("%d%20.2f\n",year,amount);
for (int year = 1; year <= 10; year++){
amount = principal * Math.pow(1+rate, year);
System.out.printf("%d%20.2f\n",year,amount);
// what is the difference between these two?
GeekTool 0 Junior Poster in Training
NormR1 563 Posting Sage Team Colleague
thines01 401 Postaholic Team Colleague Featured Poster
GeekTool 0 Junior Poster in Training
TrustyTony 888 pyMod Team Colleague Featured Poster
prnjn 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.