home *** CD-ROM | disk | FTP | other *** search
- public class App1_4 {
- public static void main(String[] args) {
- double dPerMonth = (double)Integer.parseInt(args[0]);
- double dInterest = (double)Integer.parseInt(args[1]);
- BankAccount.Rate(dInterest);
- BankAccount baMyAccount = new BankAccount();
- System.out.println("Depositing " + dPerMonth + " per month at " + BankAccount.Rate() + " per cent interest");
- System.out.println("Watch my account grow!");
- int nYear = 0;
-
- do {
- System.out.print(nYear + " - ");
- int nMonth = 0;
-
- do {
- baMyAccount.Deposit(dPerMonth);
- baMyAccount.Monthly();
- System.out.print(baMyAccount.Balance() + ", ");
- ++nMonth;
- } while(nMonth < 12);
-
- System.out.println();
- ++nYear;
- } while(nYear < 10);
-
- }
- }
-