//******************************************************************** // Transactions.java Author: Lewis/Loftus // // Demonstrates the creation and use of multiple Account objects. //******************************************************************** public class Transactions { //----------------------------------------------------------------- // Creates some bank accounts and requests various services. //----------------------------------------------------------------- public static void main (String[] args) { double murphyBalance, smithBalance, demseyBalance; double murphyDeposit, murphyWithdrawal, murphyFee; double smithDeposit; Account acct1, acct2, acct3; murphyBalance = 102.56; smithBalance = 40.00; demseyBalance = 759.32; acct1 = new Account ("Ted Murphy", 72354, murphyBalance); acct2 = new Account ("Jane Smith", 69713, smithBalance); acct3 = new Account ("Edward Demsey", 93757, demseyBalance); smithDeposit = 500.00; murphyDeposit = 25.85; murphyWithdrawal = 430.75; murphyFee = 1.50; acct1.deposit(murphyDeposit); smithBalance = acct2.deposit(smithDeposit); System.out.println ("Smith balance after deposit: " + smithBalance); murphyBalance = acct2.withdraw (murphyWithdrawal, murphyFee); System.out.println ("Murphy balance after withdrawal: " + murphyBalance); acct1.addInterest(); acct2.addInterest(); acct3.addInterest(); System.out.println (); System.out.println (acct1); System.out.println (acct2); System.out.println (acct3); } }