By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,654 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,654 IT Pros & Developers. It's quick & easy.

stuck

P: 1
Expand|Select|Wrap|Line Numbers
  1. public class Interest {
  2.  
  3.  
  4.  
  5. public static void main(String[] args)
  6.    {
  7.        double amount;
  8.        double principal = 1000.0;
  9.        double rate = 0.05;
  10.  
  11.        System.out.printf("%s%20s\n", "Year",  "Amount on deposit");
  12.  
  13.        for ( int year = 1; year <= 10; year++ );
  14.        {  
  15.            amount = principal * Math.pow( 1.0 + rate, year );
  16.            System.out.printf( "%4d%,20.2f\n", year, amount );
  17.  
  18.        }
  19.    }
  20. }
Oct 18 '13 #1
Share this Question
Share on Google+
1 Reply


Nepomuk
Expert 2.5K+
P: 3,112
Hi mod387 and welcome to bytes.com!

What's the problem with the code you posted?
Oct 18 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.