|
FeeAccount |
|
1 // joi/5/bank/FeeAccount.java 2 // 3 // 4 // Copyright 2003 Bill Campbell and Ethan Bolker 5 6 /** 7 * A FeeAccount is a BankAccount with one new feature: 8 * the user is charged for each transaction. 9 * 10 * @version 5 11 */ 12 13 public class FeeAccount extends BankAccount 14 { 15 private static int transactionFee = 1; 16 17 /** 18 * Constructor, accepting an initial balance and issuing Bank. 19 * 20 * @param initialBalance the opening balance. 21 * @param issuingBank the bank that issued this account. 22 */ 23 24 public FeeAccount( int initialBalance, Bank issuingBank ) 25 { 26 super( initialBalance, issuingBank); 27 } 28 29 /** 30 * The way a transaction is counted for a FeeAccount: it levies 31 * a transaction fee as well as counting the transaction. 32 */ 33 34 public void countTransaction() 35 { 36 incrementBalance( - transactionFee ); 37 super.countTransaction(); 38 } 39 40 /** 41 * Action to take when a new month starts. 42 */ 43 44 public void newMonth() 45 { 46 } 47 } 48
|
FeeAccount |
|