public class CheckingAccount { // instance variables private String accountNumber; private String accountHolder; private int balance; //constructors . . . . // methods . . . . public void processDeposit ( int amount ) { balance = balance + amount ; } }
If you have the previous test program in a file,
it would be nice to add the processDeposit()
method
and test it.
The method to process a check is slightly more complicated:
void
.Here is a sketch of the method:
public void processCheck( int ) { int charge; if ( < 100000 ) charge = ; else charge = ; balance = - - ; }
Fill in the blanks to complete the method. Remember that quantities of money are expressed in cents.