A good answer might be:

class CheckingAccount
{
  // instance variables
  String accountNumber;
  String accountHolder;
  int    balance;

  //constructors
  . . . .

  // methods
  . . . .

  void processDeposit ( int amount )
  {

    balance = balance + amount ;
  }

}

Method to Process Checks

If you have the previous test program in your NotePad buffer, it would be nice to add the processDeposit() method and test it. The method to process a check is slightly more complicated:

  • Assume that the amount of a check is a positive value, expressed in cents.
  • If the current balance is less than $1000.00, there is a $0.15 processing charge.
  • The amount of the check and the processing charge (if any) are subtracted from the balance.
  • The return type is void.

Here is a sketch of the method:

void processCheck( int _____________ )
{
  int charge;
  if ( ______________ < 100000 )

    charge = _________
  else

    charge = _________

  balance = ________ - _________ - _________ ;

}

QUESTION 14:

Fill in the blanks to complete the method.

Click Here after you have answered the question