Advertisement
thenewboston

Java Programming Tutorial - 23 - Compound Interest Program

Aug 22nd, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1. class apples{
  2.    public static void main(String[] args){
  3.       double amount;
  4.       double principal;
  5.       double rate = .01
  6.  
  7.       for(int day=1;day<=20;day++){
  8.          amount=principal*Math.pow(1 + rate, day);
  9.          System.out.println(day + "   "+ amount);
  10.       }
  11.    }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement