stuck

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mod387
    New Member
    • Oct 2013
    • 1

    stuck

    Code:
    public class Interest {
      
    
    
    public static void main(String[] args)
       {
    	   double amount;
    	   double principal = 1000.0;
    	   double rate = 0.05;
    	   
    	   System.out.printf("%s%20s\n", "Year",  "Amount on deposit");
    	   
    	   for ( int year = 1; year <= 10; year++ );
    	   {  
    		   amount = principal * Math.pow( 1.0 + rate, year );
    		   System.out.printf( "%4d%,20.2f\n", year, amount );
    		  
    	   }
       }
    }
    Last edited by Rabbit; Oct 18 '13, 06:10 AM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    Hi mod387 and welcome to bytes.com!

    What's the problem with the code you posted?

    Comment

    Working...