Banking2 - smithBalance); System.out.println ("Smith...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // Banking.java Author: Lewis/Loftus // // Solution to Programming Project 4.2 //******************************************************************** public class Banking2 { //----------------------------------------------------------------- // Creates some bank accounts and requests various services. //----------------------------------------------------------------- public static void main (String[] args) { Account2 acct1 = new Account2 ("Ted Murphy", 72354, 102.56); Account2 acct2 = new Account2 ("Jane Smith", 69713); Account2 acct3 = new Account2 ("Edward Demsey", 93757, 759.32); acct1.deposit (25.85); double smithBalance = acct2.deposit (500.00); System.out.println ("Smith balance after deposit: " +
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: smithBalance); System.out.println ("Smith balance after withdrawal: " + acct2.withdraw (430.75, 1.50)); acct3.withdraw (800.00, 0.0); // exceeds balance System.out.print("\nTransfer to Demsey from Smith "); if (Account2.transfer(600,2,acct2, acct3)) System.out.println("successful"); else System.out.println("failed"); System.out.print("\nTransfer to Demsey from Murphy "); if (Account2.transfer(40,2,acct1, acct3)) System.out.println("successful"); else System.out.println("failed"); acct1.addInterest(); acct2.addInterest(); acct3.addInterest(); System.out.println (); System.out.println (acct1); System.out.println (acct2); System.out.println (acct3); } }...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online