class CheckingAccount
{
private String accountNumber;
private String accountHolder;
private int balance;
private int useCount = 0;
CheckingAccount( String accNumber, String holder, int start ) { . . . . }
private void incrementUse() { . . . . }
int currentBalance() { . . . . }
void processDeposit( int amount ) { . . . . }
void processCheck( int amount ) { . . . . }
void display() { . . . . }
}
class CheckingAccountTester
{
public static void main( String[] args )
{
CheckingAccount bobsAccount = new CheckingAccount( "999", "Bob", 100 );
CheckingAccount jillsAccount = new CheckingAccount( "111", "Jill", 500 );
bobsAccount.processCheck( 50 );
bobsAccount.processDeposit( 150 );
bobsAccount.processCheck( 50 );
jillsAccount.processDeposit( 500 );
jillsAccount.processCheck( 100 );
jillsAccount.processCheck( 100 );
jillsAccount.processDeposit( 100 );
bobsAccount.display();
jillsAccount.display();
}
}
|