previous | start | next

File InvestmentTest.java

1 /**
2     This program computes how much an investment grows in
3     a given number of years.
4 */
5 public class InvestmentTest
6 {
7    public static void main(String[] args)
8    {
9       final double INITIAL_BALANCE = 10000;
10       final double RATE = 5;
11       final int YEARS = 20;
12       Investment invest = new Investment(INITIAL_BALANCE, RATE);
13       invest.waitYears(YEARS);
14       double balance = invest.getBalance();
15       System.out.println("The balance after " + YEARS + 
16          " years is " + balance);
17    }   
18 }



previous | start | next