package cc.glsn.v15; public class Investment { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub new Investment(); } public Investment() { double Start=3000.00; double Monthly=333.33; double Interest=0.10; int Years=30; double M=Start; for(int i=0; i<12*Years; i++) { if (i % 12 == 0) { int year=i/12; System.out.println("Start of year " + year + ": " + M); } M=M+M*Interest/12.0 + Monthly; } System.out.println("End of year " + Years + ": " + M); } }